-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] --abort-on-uncaught-exception
causes containsModuleSyntax
to improperly throw Uncaught SyntaxError: Cannot use import statement outside a module
#50878
Comments
Let me know if you need more details on how to reproduce, I could perhaps create a small repo to show the issue if it helps. |
Could you produce a repro that doesn't include downloading any external code? If not, you should report it to the dependency you are using. |
Working on reproducing it in a standalone file, but this behaviour change happens strictly if running this with Node.js 20.10.0:
|
I've put together a repo here: https://github.com/tjenkinson/node-20.10.0-ERR_REQUIRE_ESM-crash It seems instead of the From the debugger it looks like it might be a crash happening in the internal |
Just pushed a new commit to that repro that changes it slightly. It seems to be when it's a module in |
Looks like the crash is here: node/lib/internal/modules/cjs/loader.js Line 1406 in 4e713a3
And this was added in a9b2535 |
Here's a C++ backtrace:
|
The crash happens within a TryCatch scope, so it seems like a V8 bug. It shouldn't abort in this case. |
I added some logs to the node/deps/v8/src/execution/isolate.cc Lines 2437 to 2438 in 4e713a3
/cc @nodejs/cpp-reviewers |
This looks like a negligence from our side of not disabling aborting temporarily for the syntax check in our ShouldAbortOnUncaughtException callback. |
cc @nodejs/loaders |
@KidkArolis I opened a PR that fixes this issue. |
@joyeecheung how do you explain that |
I think that's for JavaScript |
--abort-on-uncaught-exception
causes containsModuleSyntax
to improperly throw Uncaught SyntaxError: Cannot use import statement outside a module
Version
20.10.0
Platform
Linux Alpine
Subsystem
No response
What steps will reproduce the bug?
This command works in 20.9.0, but not in 20.10.0, specifically when
--abort-on-uncaught-exception
opt is passed in:The version of knex:
How often does it reproduce? Is there a required condition?
Fails every time!
What is the expected behavior? Why is that the expected behavior?
The migration was created by knex in 20.9.0
What do you see instead?
Now it fails with this output:
Additional information
No response
The text was updated successfully, but these errors were encountered: