esm: fix base URL for network imports#42131
Closed
bmeck wants to merge 6 commits into
Closed
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/