[HTML5] Preloader reports "Error loading asset" with { error: null, responseData: null } for assets that exist and return 200 OK

Description

The Lime preloader intermittently fails to load image assets during preloading on the HTML5 target, even though the assets are confirmed to be available
and served correctly from the CDN (HTTP 200, valid PNG data, proper CORS headers with Access-Control-Allow-Origin: *).

Error Output

[lime.utils.Preloader] ERROR: Error loading asset “assets/html/led.png”: {
error : null,
responseData : null
}

Multiple assets fail simultaneously:

assets/html/led.png
assets/html/lamp_outer2.png
assets/html/lamp_shine10.png
assets/lamp_glow.png

Environment

Lime: 8.3.0
OpenFL: 9.5.0
Target: HTML5
Browser: Chrome 147.0.0
OS: Windows >=10
Embed config: Assets loaded cross-origin from CDN with rootPath pointing to a remote URL

Reproduction

Build an OpenFL app with multiple image assets configured as preload=“true” in project.xml
Serve the built app from a CDN (cross-origin) with proper CORS headers
The preloader loads assets via HTML5HTTPRequest.__loadImage() which uses JavaScript Image objects with crossOrigin = “Anonymous”
Intermittently, some image assets fail to load with null error details
Verified Not a Server/CDN Issue

All failing assets return HTTP 200 with valid PNG image data
CORS headers are present: Access-Control-Allow-Origin: *
Content-Type header is application/octet-stream (not image/png) — this could be a factor

Downloads complete successfully when tested with curl

Is this a known issue? Any advice on how to handle or work around this intermittent failure?

Check if the relative path of the assets from the URL of the page where your content is loading is valid. I had a similar problem recently and this was the case. Confirm that the URL of the page you are accessing + “assets/html/led.png” (which seems to be the relative path of your image) is valid. It may be valid from the path of your exported JS file, but not from the URL of the page where it is actually embedded.

I don’t think this is a persistent issue. I tested it locally and in prod and it worked fine, but I only noticed the error because it showed up in Sentry logs, which is a bit confusing..