-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Version 1.9.1 is not working with ESM #785
Comments
It turned out that adding the second --import flag was not the issue. The issue also occurs without it. I was using @swc-node/register version 1.9.1. After downgrading to 1.8.0, swc is working again. |
I think it might be fixed by this PR: #781 Are you sure downgrading to just v1.9.0 is not solving it for you? Oh yeah, if you are using Node v20 or later you don't need the |
Thank you for the tip that .env support is now built-in to Node.js. Totally missed that in the Changelog.
|
@P4sca1 Sorry, for keep asking you to try things. If I followed along a discussion on OpenTelemetry repos correctly. You might want to give |
tried version 1.8.0 and it does not solve the issue. |
@P4sca1 It was worth a try. I am curious if these loaders need to be build in a special manner to support multiple loaders at the same time. I do think |
To verifiy wheter this is an issue with the SWC loader not supporting multiple loaders, I created a simple JavaScript file, which just logs to the console. I can confirm that it works together with the SWC loader without issues. So this is likely an issue with the Sentry SDK and import-in-the-middle. |
|
It could be an issue with The following fails for me with Node v22 and
With the following error:
|
I think #781 should have fixed the multiple import hooks problem, please try and feedback if you like |
@timfish I tested using Node v22.2.0, |
I added a second --import statement to initialize the Sentry SDK like so:
node --import ./instrument.js --import @swc-node/register/esm-register -r dotenv/config ./src/main.ts
.This results in the following error:
The text was updated successfully, but these errors were encountered: