Skip to content
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

Fix relative imports in wasm loader #3752

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simolus3
Copy link
Contributor

Currently, the loader script emitted by build_web_compilers resolves URLs against the base-URL of the active document. This breaks when the entrypoint script is not in the same directory as the page, e.g. in

web/
  index.html
  src/
    app.dart

To fix this, this PR changes the logic to resolve URLs against the loader script (which would be /src/app.dart.js in the example, properly resolving the other dart2wasm/dart2js components).
I've also added an integration test using a <script> tag pointing to a subdirectory to make sure that this is working now.

Closes #3751

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

Successfully merging this pull request may close these issues.

[build_web_compilers] wasm compilation bug with non-root entrypoint
1 participant