require()
of malformed script uncatchably crashes the process
#493
Labels
require()
of malformed script uncatchably crashes the process
#493
Acknowledgements
Minimal reproduction URL
https://stackblitz.com/edit/stackblitz-starters-xedxss?file=load.mjs
Version
4.7.1
Node.js version
18.18.0
Package manager
npm
Operating system
Linux
Problem & Expected behavior
See the attached stackblitz MRE.
Basically I'm trying to
require()
user-supplied code that may be malformed. This causes thetsx
process to die immediately. There appears to be no way of preventing this. (try-catch,uncaughtException
event, andunhandledPromise
event are all ineffective.)You can see this by running
npm start
:require()
'ing a module should behave similar to how running this directly in node works. E.g.node load.mjs
produces the following...In other words ...
require()
.Note: Possibly related to issue #472, but as you noted the description there is a bit vague. Maybe this issue will help?
Contributions
The text was updated successfully, but these errors were encountered: