Open MattIPv4 opened 1 week ago
For some additional context, this works fine in @sentry/node@7
. This is blocking our upgrade to @sentry/node@8
. In our actual code, the usage of .
in exports
comes from files generated by grpc-tools
, which are then run through @grpc/grpc-js
.
Sorry for the trouble, this is def some issues with the new automatic instrumentation in 8.x
.
Could you apply patch-package
with the linked patch here https://github.com/getsentry/sentry-javascript/issues/12485#issuecomment-2169398097 and see if the error goes away?
I had to install import-in-the-middle@1.8.0
as the patch failed on 1.8.1
, so my package.json
now looks like this (from the repro above):
{
"type": "module",
"scripts": {
"postinstall": "patch-package"
},
"dependencies": {
"@sentry/node": "^8.11.0",
"import-in-the-middle": "^1.8.0",
"patch-package": "^8.0.0"
}
}
Running npm i
shows that patch-package
is applying the patch, however node index.js
still results in the same syntax error as above.
This is currently tracked upstream by https://github.com/DataDog/import-in-the-middle/issues/94
I've been thinking of some ways to work around this and should get a PR submitted this week!
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.11.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
package.json
:index.js
:other.cjs
:Expected Result
It runs, outputting:
(this can be reproduced by commenting out the
Sentry.init();
line)Actual Result
It fails on a sytax error: