-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
esm: fix http(s) import via custom loader #43130
esm: fix http(s) import via custom loader #43130
Conversation
Review requested:
|
@guybedford I quickly looked into the ModuleJob avenue you suggested, but I'm pretty sure it will take longer than the next ~hour I have before being gone a week. To resolve this bug sooner rather than later, I say we go with this workable-but-not-quite-ideal fix and improve it in a follow-up (which I'd be happy to do when I get back, probably after switching I updated the jsdocs and added some "there be dragons" code docs. |
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.
Please confirm that the tests fail without your lib/
changes.
I did (see #43130 (comment)) |
@JakobJingleheimer I hope you don't mind I pushed a commit to add a fetch cache guard to avoid double fetching and clarify the contract. As mentioned before the architectural fix should be:
For now it would be great to get this fix merged certainly. |
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.
A few optional nits, otherwise LGTM :)
Hi! When do you merge this PR or how can I help with this? thanks! PD: There is some workaround ? |
@guybedford I don't mind 🙂 thanks! Good improvement! @aduh95 good nits, especially the test one. I can't apply them right now. Would you mind batch-committing them and add the label to merge? (GitHub mobile doesn't support it) |
Landed in b5ed1bd |
Hi @JakobJingleheimer. This doesn't land cleanly on v18.x. Could you submit a backport PR? |
I am not on my computer to link to it, but this depends on a previous loaders PR that has the backport blocked label |
What @targos said (it's not supposed to yet). Sorry, should I apply a label or something? |
@JakobJingleheimer I'll just change the label to backport blocked. If someone can throw the link in here to the previous PR once they find it, that would be great, so we can make sure that this one lands on a release when that one does. |
PR-URL: #43130 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #43130 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #43130 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #43130 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs/node#43130 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
When a custom loader is used to load a remote asset via http(s), the internal cache is circumvented. This results in a nested import's resolution to run into an unsettled promise (causing
parentURL
to beundefined
instead of its actual value).fixes #42721
TODO: