Skip to content

ESM script load URL fix #7666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

ESM script load URL fix #7666

wants to merge 2 commits into from

Conversation

kpal81xd
Copy link
Contributor

@kpal81xd kpal81xd commented May 13, 2025

  • Fixes issue where query parameters are dropped when loading ESM script in ESM Preload Fix #7161 (id and branchId) causing launcher to fail to fetch asset source

@kpal81xd kpal81xd self-assigned this May 13, 2025
@marklundin
Copy link
Member

Omitting the query string is intentional here. See this comment playcanvas/editor#1236 (comment).

If the engine loads utils.mjs?hash=123 and later a user directly imports import 'utils.mjs' it will treat these as 2 modules, which is a problem if they have internal state. This issue was reported on Discord originally https://discord.com/channels/408617316415307776/1242436398678671401/1312763719062913065

If scripts are not loading, it's may be because "Bypass for network" is disabled in Dev tools > Application > SW. This will bypass the loading behaviour

image

@marklundin
Copy link
Member

We should probably handle this better in the editor, potentially adding a check and warning users

@marklundin marklundin closed this May 20, 2025
@marklundin
Copy link
Member

Closing this, as it will cause issues if merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants