-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
fix(module-runner): keep same import with different importer separately #20944
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
base: main
Are you sure you want to change the base?
fix(module-runner): keep same import with different importer separately #20944
Conversation
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.
Makes sense. Externalized dep (i.e. bare specifier) is resolved based on importer
in fetchModule
, so it would technically get mixed up if there are two different node_modules
separately.
Strange that you did not encounter any issue. We had the code work like this before, but it actually doesn't make sense because it will only cache modules inside the same module in that case, so the cache will almost never be hit. The url is almost always already resolved by the import analyser plugin, and dynamic imports also resolves it manually before calling fetch. I will try to find the issue why we changed it back to only url |
Oh right. Caching module for already resolved url was the point. I guess this is technically desired only for unresolved url at this point, which is externalized dep, but I'd imagine that's less problematic than changing it. |
/ecosystem-ci run |
commit: |
True,
|
📝 Ran ecosystem CI on
✅ ladle, analogjs, one, rakkas, histoire, marko, quasar, nuxt, unocss, storybook, vite-environment-examples, vite-plugin-vue, vike, vite-plugin-react, vitepress, vuepress, sveltekit, vite-setup-catalogue, vite-plugin-svelte, vite-plugin-cloudflare, vite-plugin-pwa, vitest, vite-plugin-rsc, astro |
Description
Since
fetchModule
may return a different value depending onimporter
even ifurl
is the same, I thinkthis.concurrentModuleNodePromises
should haveurl
+importer
as a key.I noticed this while reading the code and haven't encountered any specific issues.