-
Notifications
You must be signed in to change notification settings - Fork 26
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
Crash when using import-in-the-middle
with module.exports = {...require('$dependency')}
#157
Comments
This doesn't look like a crash. It's a logged error telling you a module could not be wrapped. |
Thanks for the quick response! no test is run though, meaning
vs without the loader:
|
hey @timfish do you need more information? I can also try to debug it myself if you can give me some pointers 😄 |
I've not had a chance to look yet but my guess is that this is something to do with the parser.. although the parser should only be used for ESM. |
Expected Behavior
Using a
myloader.mjs
file like thisand using
NODE_OPTIONS='--import ./myloader.mjs' $my_command
does not crash.Actual Behavior
Running
results in
Steps to Reproduce the Problem
starter-kit
fork:--import
flag:See this error:
Specifications
Running
npx envinfo
Investigation
If you look at
node_modules/@prisma/client/default.js
the file looks like this:Funnily enough, if you change the file contents to this:
the crash does not happen anymore.
Context
DataDog/dd-trace-js#4713
The text was updated successfully, but these errors were encountered: