[lime.utils.Preloader] ERROR: Error loading asset

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:

  1. 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)”}

  2. val: “[lime.utils.Preloader] ERROR: Error loading asset “embeds/models/vehicle.3DS””

  3. message: (…)

  4. 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)”

  5. proto: Error

  6. val: null

  7. class: ƒ (val)

  8. wrap: ƒ (val)

  9. name: “js._Boot.HaxeError”

  10. super: ƒ Error()

  11. arguments: (…)

  12. caller: (…)

  13. length: 1

  14. name: “js__$Boot_HaxeError”

  15. prototype: Error {val: null, class: ƒ}

  16. proto: ƒ ()

  17. [[FunctionLocation]]: mygame.js:83780

  18. [[Scopes]]: Scopes[4]

  19. message: (…)

  20. get message: ƒ ()

  21. proto:

  22. constructor: ƒ Error()

  23. message: “”

  24. name: “Error”

  25. toString: ƒ toString()

  26. proto:

  27. constructor: ƒ Object()

  28. hasOwnProperty: ƒ hasOwnProperty()

  29. isPrototypeOf: ƒ isPrototypeOf()

  30. propertyIsEnumerable: ƒ propertyIsEnumerable()

  31. toLocaleString: ƒ toLocaleString()

  32. toString: ƒ toString()

  33. valueOf: ƒ valueOf()

  34. defineGetter: ƒ defineGetter()

  35. defineSetter: ƒ defineSetter()

  36. lookupGetter: ƒ lookupGetter()

  37. lookupSetter: ƒ lookupSetter()

  38. get proto: ƒ proto()

  39. 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”