You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): keep lazy_loaded_esm sources across concurrent loads (#34353)
Two concurrent dynamic imports that both transitively depend on the same
lazy-loaded ESM module (e.g. `node:assert`) could fail with `Unsupported
scheme "node"`. Each `import()` spawns its own `RecursiveModuleLoad`,
and the per-load `visited`/`get_id` dedup misses across loads — both queue a
load future for the lazy specifier. `take_lazy_esm_source` removed the
source on first call, so the second future got `None` and fell through
to `loader.load()`, which doesn't handle `node:` builtins. This manifests
on vite 8 + react-router 7.15 under their CJS bin, where prettier
(loaded via `require`) and vite's `chunks/node.js` both import
`node:assert`.
Return a cheap clone (via `FastString::into_cheap_copy`) instead of
removing the entry. The duplicate `ModuleSource`s are deduplicated by
`new_module_with_pending`'s existing `get_id` check at register time.
Fixes#34307
0 commit comments