Hi. The html5 version of my project works fine offline (with openfl test html5), but when I put the published files on the server, I get the following error for all .3ds assets. Any ideas what would trigger this? I’m not sure if I need to ask the server admin to do something.
js__$Boot_HaxeError {val: “[lime.utils.Preloader] ERROR: Error loading asset “embeds/models/vehicle.3DS””, stack: "Error: [lime.utils.Preloader]
I noticed that a couple of the .3ds assets don’t throw the error. Any ideas what would cause this error?
Do all of your assets error, or only some of them? Does the server configuration allow for the 3DS file extension? Does the case (uppercase, lowercase) of the file extension make a difference on the server?
Most seem to load, including three of the .3ds files. I get an error on a couple of fonts and the rest of the .3ds assets. The server admin said they added the 3ds MIME type after my request. I’ve coded keeping case sensitivity in mind.
What does the error stack show?
There are no errors testing offline. This is a sample error from server using Chrome:
-
js__$Boot_HaxeError {val: “[lime.utils.Preloader] ERROR: Error loading asset “embeds/models/vehicle.3DS””, stack: “Error: [lime.utils.Preloader] ERROR: Error loading…T_SCORM-20190912085827/mygame.js:84486:13)”}
-
val: “[lime.utils.Preloader] ERROR: Error loading asset “embeds/models/vehicle.3DS””
-
message: (…)
-
stack: "Error: [lime.utils.Preloader] ERROR: Error loading asset “embeds/models/vehicle.3DS"↵ at Function.lime_utils_Log.error (< url >/mygame.js:100971:10)↵ at < url >/mygame.js:101092:21↵ at lime_app_Promise.error (< url >/mygame.js:89279:6)↵ at lime_utils_AssetLibrary.load_onError (< url >/mygame.js:99914:17)↵ at < url >/mygame.js:99349:14↵ at lime_app_Promise.error (< url >/mygame.js:89279:6)↵ at lime_app_Promise.error (< url >/mygame.js:89279:6)↵ at XMLHttpRequest.readyStateChange (< url >/mygame.js:84486:13)”
-
proto: Error
-
val: null
-
class: ƒ (val)
-
wrap: ƒ (val)
-
name: “js._Boot.HaxeError”
-
super: ƒ Error()
-
arguments: (…)
-
caller: (…)
-
length: 1
-
name: “js__$Boot_HaxeError”
-
prototype: Error {val: null, class: ƒ}
-
proto: ƒ ()
-
[[FunctionLocation]]: mygame.js:83780
-
[[Scopes]]: Scopes[4]
-
message: (…)
-
get message: ƒ ()
-
proto:
-
constructor: ƒ Error()
-
message: “”
-
name: “Error”
-
toString: ƒ toString()
-
proto:
-
constructor: ƒ Object()
-
hasOwnProperty: ƒ hasOwnProperty()
-
isPrototypeOf: ƒ isPrototypeOf()
-
propertyIsEnumerable: ƒ propertyIsEnumerable()
-
toLocaleString: ƒ toLocaleString()
-
toString: ƒ toString()
-
valueOf: ƒ valueOf()
-
defineGetter: ƒ defineGetter()
-
defineSetter: ƒ defineSetter()
-
lookupGetter: ƒ lookupGetter()
-
lookupSetter: ƒ lookupSetter()
-
get proto: ƒ proto()
-
set proto: ƒ proto()
The Basic_Load3DS example works on the server, so that rules out a problem with 3ds. One thing I’m doing differently is using multiple 3ds files and Asset3DLibrary.enableParser(Max3DSParser) to load meshes individually. I’m going to continue to troubleshoot and post any breakthroughs.
I’ve had some success!!! On another project with fewer 3ds files, I had to keep refreshing, but it finally loaded and works! I’m not sure how to get this working seamlessly. Any suggestions would be greatly appreciated!! Getting closer though!
I’m not sure if all of this is going through https://github.com/openfl/lime/blob/develop/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx#L34 but perhaps the issue is loading too many files at once? It begins to error with some of the files?
I’ve tried a low requestLimit and I’ve tried an extremely large requestLimit; same result. For some reason, now on multiple servers, the loading process throws preloader errors until I’ve refreshed a bunch of times. Is there a good example of using a queue? Would making a bundle be better? Right now, I have everything “loose” in a folder.
Strange — does it do this on a different server?
Yes. When trying to view the project from a server, errors are thrown for some assets until I refresh every time it gets stuck. Finally, it loads. I was just attempting to make the request limit 4 and 6 to see but the loading always gets stuck.
Note, the only files that throw loading errors are font and 3ds files. jpgs, pngs, etc., always work. Again, the ones throwing errors eventually load after many Refreshes. Not sure if that helps.
What’s the server type? Is it behind a CDN?
Server is Windows/IIS, no CDN
Success!!! From this thread: OpenFL 7 AssetLibrary
I changed my project.xml file to use:
<library id="assetlib2" type="gzip" preload="true" />
<assets path="embeds/models" library="assetlib2" />
Then, in the hx file I used:
Asset3DLibrary.loadData(Assets.getBytes("assetlib2:embeds/models/cover.3DS"));
MIME types for 3DS and pak had to be added to the server, but we’re in business! I hope this helps someone else.
The code was removed from entry above for what I did in project.xml, so I’m copying again without open/close brackets on each line.
library id=“assetlib2” type=“gzip” preload=“true”
assets path=“embeds/models” library=“assetlib2”