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
Now run node --no-warnings --loader=./loader.mjs index.mjs
How often does it reproduce? Is there a required condition?
Every time it runs.
What is the expected behavior? Why is that the expected behavior?
See Loader loading... once
What do you see instead?
An infinite loop of loader loading... console lines until the program ends.
Additional information
I found it out while coding quibble (a module mock library) to support off worker threads. A simple loader, while being infinitely loaded, will still work: probably the first module loaded is used, but the module loading will continue while the program is running. quibble failed to work because it uses globalPreload and that was being called again and again and again...
The text was updated successfully, but these errors were encountered:
Version
v20.0.0
Platform
Linux Dell-GilTayar 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
modules
What steps will reproduce the bug?
You can find the above code here: https://github.com/giltayar/global-preload-called-twice
Now run
node --no-warnings --loader=./loader.mjs index.mjs
How often does it reproduce? Is there a required condition?
Every time it runs.
What is the expected behavior? Why is that the expected behavior?
See
Loader loading...
onceWhat do you see instead?
An infinite loop of
loader loading...
console lines until the program ends.Additional information
I found it out while coding
quibble
(a module mock library) to support off worker threads. A simple loader, while being infinitely loaded, will still work: probably the first module loaded is used, but the module loading will continue while the program is running.quibble
failed to work because it usesglobalPreload
and that was being called again and again and again...The text was updated successfully, but these errors were encountered: