Repository navigation
Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.
@sentry/node
SDK Version
7.42.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
- Install
@sentry/types,@sentry/tracing,@sentry/integrationsand@sentry/nodeversion7.41.0. - Init Sentry and Sentry tracing.
- Run a TypeScript build.
- See the build succeed.
- Install version
7.42.0. - Run TypeScript build.
- See the build fail.
Expected Result
It should build without errors.
Actual Result
Throws the following build error:
pnpm build
> @expatfile/grpc-utils@0.0.0-development build /Users/zinohofmann/Projects/github.com/expatfile/grpc-utils
> tsc -p .
node_modules/.pnpm/@sentry+types@7.42.0/node_modules/@sentry/types/types/instrument.d.ts:1:43 - error TS2304: Cannot find name 'BufferSource'.
1 declare type XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;
~~~~~~~~~~~~
node_modules/.pnpm/@sentry+types@7.42.0/node_modules/@sentry/types/types/instrument.d.ts:1:58 - error TS2304: Cannot find name 'FormData'.
1 declare type XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;
~~~~~~~~
node_modules/.pnpm/@sentry+types@7.42.0/node_modules/@sentry/types/types/instrument.d.ts:2:54 - error TS2304: Cannot find name 'XMLHttpRequest'.
2 export interface SentryWrappedXMLHttpRequest extends XMLHttpRequest {
~~~~~~~~~~~~~~
node_modules/.pnpm/@sentry+types@7.42.0/node_modules/@sentry/types/types/instrument.d.ts:19:16 - error TS2304: Cannot find name 'Response'.
19 response?: Response;
~~~~~~~~
Found 4 errors in the same file, starting at: node_modules/.pnpm/@sentry+types@7.42.0/node_modules/@sentry/types/types/instrument.d.ts:1
ELIFECYCLE Command failed with exit code 1.
Reacted by Silas Rech, Bjarne Grimberg, Luca and Sascha Mirow-Stanitzok
Metadata
Metadata
Assignees
Labels
No labels
Activity
lenovouser commentedon Mar 12, 2023
#7382 is the PR that introduced this bug, specifically the following line:
sentry-javascript/packages/types/src/index.ts
Line 97 in 2615ab3
mydea commentedon Mar 13, 2023
Hello @HofmannZ ,
thank you for the report, this def. seems like something we should fix.
However, I just tried this in a very barebones express app using
ts-nodeand it seemed to work fine. Can you provide more detail on your setup:Sentry.init()configI suspect this has to do with how the code/types are tree shaken. (To be clear if that is the case we def. still need to fix this on our end, we'd just like to have a working reproduction so we can add a test to prevent future regressions like this)
smirowstanitzok commentedon Mar 13, 2023
This reminds me of issue #5199. Again, the problem is that the DOM library is required. A possible fix/workaround is adding the library in tsconfig.json:
For pure backend/Node.js applications, however, this is not a clean way. We would like the dependency on DOM Types to be removed.
mydea commentedon Mar 13, 2023
Yes, to be clear we absolutely consider this a regression, you shouldn't need to adjust your tsconfig for this. We have an open PR and plan to ship a patch release as soon as possible!
mydea commentedon Mar 13, 2023
This should be fixed in 7.43.0 - thank you for reporting!
HofmannZ commentedon Mar 13, 2023
Version
7.43.0solves the issue. Thanks!