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
The text was updated successfully, but these errors were encountered:
VoltrexKeyva
added
esm
Issues and PRs related to the ECMAScript Modules implementation.
loaders
Issues and PRs related to ES module loaders
labels
Apr 12, 2023
Version
19.8.0
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
esm
What steps will reproduce the bug?
Issue occurs when chaining 3 or more loaders
loader-a.mjs
loader-b.mjs
loader-c.mjs
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
The above
node
run would outputIn other words, each loader would be chained to resolve subsequent loaders as per #43772 and docs:
What do you see instead?
Only the immediately preceding loader is used to load a loader
Additional information
This regression was introduced in #45869, first released in v19.8.0
The feature in question is implemented by added loaded loaders to the internal ESM loader by calling
ESMLoader#addCustomLoaders
in a loopnode/lib/internal/process/esm_loader.js
Lines 46 to 58 in 4221dce
Before the regression,
ESMLoader#addCustomLoaders
mutatesthis.#hooks
, thus multiple calls to it will add to the internal loader chainnode/lib/internal/modules/esm/loader.js
Lines 317 to 359 in 00a428e
In #45869,
ESMLoader#addCustomLoaders
was changed to (re-)instantiating aHooks
object, making multiple calls to it overwritingthis.#hooks
node/lib/internal/modules/esm/loader.js
Lines 108 to 111 in 4221dce
The text was updated successfully, but these errors were encountered: