-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
esm: fix base URL for network imports #42131
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
Conversation
|
Review requested:
|
|
this PR depends on #42119 |
guybedford
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, if we move to multiple loaders in the same context we might have to reconsider the approach though.
Agreed it would be nice to clean up the callbackMap for a better approach at some point.
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cranking this out so fast! 🙌 This was a bit of a doozy to investigate and noodle.
Co-authored-by: Mestery <mestery@protonmail.com>
Co-authored-by: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
|
had to rebase due to test failure, going to land in after CI and a small wait |
|
CI tests look to be flaky per @nodejs/reliability, running last CI then merging if no other tests fail |
|
Landed in acc11c9 |
This comment was marked as outdated.
This comment was marked as outdated.
|
Waiting on backport: #42726 |
Per the PR text this kind of explains what is going on:
Likely this should be a bigger refactor because callbackMap is becoming spaghetti but that should/can be punted for now.
This is 1/2 of the issues we have seen with HTTPS CDNs for ESM and is a partial fix for #42098 .
I would note that the URL mentioned in the corresponding issue continues to fail even with this and #42119 because it redirects to an absolute URL with a 404:
Before this PR the base URL used for resolving
./rng.jswas incorrectly using the cache key of the modulehttps://unpkg.com/uuid?module. Per WHATWG this should actually be changed tohttps://unpkg.com/uuid@8.3.2/dist/esm-node/index.js?moduleAnd WHATWG:
After both PRs the behavior in Node matches the browser: https://jsfiddle.net/n8cwL4bm/