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
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
shebang line is stripped, no syntax error
What do you see instead?
syntax error
Additional information
Shebang lines are supposed to be stripped when loading modules. This was moved from internal/modules/cjs to V8, see 702331be90
Also, loaded modules are wrapped in an IIFE to provide context; this originally used Module.wrapper, but was changed to use an internal contextify module, with a fallback to the old implementation if Module.wrapper is monkey-patched, see 5f8ccecaa2
However, the shebang change seems to have broken the monkey-patching support. In this case, the shebang line is not stripped in internal/modules/cjs, but the module is wrapped in an IIFE, so the shebang is now inside the IIFE.
The text was updated successfully, but these errors were encountered:
for us it breaks loading plant-uml package to auto-generate uml images while running jsdoc...
No nice images anymore in docs, just a sea of gray :-(
Is there anyone working on it? Its not an electron only problem. We have this too without "electron" or "rewire" trying to create JSDoc documentation from source files.
jaked
added a commit
to jaked/programmable-matter
that referenced
this issue
Aug 3, 2021
browsersync and dev-ip don't load because they run into
nodejs/node#36173
in my build I commented out the shebang lines :/. need to remove
browsersync or switch to livereload.
We are hitting this problem too. It happens whenever your project imports both a module that involves a shebang line, and another module that patches the module loader.
In that situation, as pointed out by @jaked , the patching of the module loader causes the old implementation to kick in, resulting in the shebang line to not be removed by V8.
The stripShebang function should be reinstated in the case of a patched module loader.
What steps will reproduce the bug?
in file
test.js
:then
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
shebang line is stripped, no syntax error
What do you see instead?
syntax error
Additional information
Shebang lines are supposed to be stripped when loading modules. This was moved from
internal/modules/cjs
to V8, see 702331be90Also, loaded modules are wrapped in an IIFE to provide context; this originally used
Module.wrapper
, but was changed to use an internalcontextify
module, with a fallback to the old implementation ifModule.wrapper
is monkey-patched, see 5f8ccecaa2(I'm using Electron, which monkey-patches
Module.wrapper
, see electron/electron@a4fcc32799)However, the shebang change seems to have broken the monkey-patching support. In this case, the shebang line is not stripped in
internal/modules/cjs
, but the module is wrapped in an IIFE, so the shebang is now inside the IIFE.The text was updated successfully, but these errors were encountered: