-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Description
Description
When running Phaser under the file:// protocol (no local HTTP server),
the Loader incorrectly treats absolute file:// URLs as relative.
As a result, baseURL is prepended to them, producing an invalid
combined URL.
This issue affects:
- Manual resource loading using
file://URLs - Spine atlas loading, because page images inside a
.atlasfile
often include absolutefile://paths- Phaser automatically loads these image URLs\
- Loader misinterprets them\
- Resulting URL becomes invalid → image fails to load
Example of incorrect behaviour:
baseURL: file:///Users/me/project/
file.url: file:///Users/me/project/assets/spineboy-pma.png
Result:
file:///Users/me/project/file:///Users/me/project/assets/spineboy-pma.png
This happens because GetURL() does not classify file:// as an
absolute URL, unlike http(s)://, blob:, data:, etc.
Reproduction
1. Basic resource load
this.load.setBaseURL("file:///Users/me/project/");
this.load.image("pic", "file:///Users/me/project/assets/img.png");
// Incorrect: baseURL is prepended to an already absolute file:// URL2. Spine atlas loading
Inside spineboy.atlas:
file:///Users/me/project/assets/spineboy-pma.png
Phaser automatically loads the page image referenced in the atlas.
But because the URL starts with file://, Loader incorrectly prefixes
baseURL, producing an invalid URL → page image fails to load.
Expected behaviour
file://URLs should be treated as absolute (same as
http/https/blob/data).- Loader should not prepend
baseURLto them. - Spine atlas auto-loading should correctly load page images
referenced with absolutefile://URLs.
Affected versions
Phaser every version
Related PR
Fix PR: #7210
Metadata
Metadata
Assignees
Labels
No labels