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?
@sentry/node
SDK Version
7.51.2
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Sentry.init({
dsn: __MY_DSN__,
tracesSampleRate: 1.0,
});
Steps to Reproduce
- Create a project using TS 5.0.4
- Use a tsconfig.json like this
{
"compilerOptions": {
"outDir": "lib",
"allowJs": true,
"alwaysStrict": true,
"declaration": true,
"experimentalDecorators": true,
"sourceMap": true,
"inlineSources": true,
"sourceRoot": "/",
"lib": ["es2022"],
"module": "CommonJS",
"noEmitOnError": false,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"resolveJsonModule": true,
"strict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"stripInternal": true,
"skipDefaultLibCheck": true,
"target": "ES2020",
"incremental": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "nodenext"
},
"include": ["src/**/*.ts", "test/**/*.ts"],
"exclude": ["node_modules/", "**/*.d.ts"]
}
- Create a trace in e.g. src/index.ts
import * as Sentry from "@sentry/node";
Sentry.init({
dsn: __MY_DSN__,
tracesSampleRate: 1.0,
});
const transaction = Sentry.startTransaction({ name: "demo" });
transaction.finish()
- Run
tsc
- Execute
node lib/src/index.js
Expected Result
Traces being tracked
Actual Result
Error is thrown on startTransactiion:
TypeError: Cannot read properties of undefined (reading '0')
at /my-project/node_modules/@sentry/core/node_modules/@sentry/utils/cjs/misc.js:21:87
at /my-project/node_modules/@sentry/core/node_modules/@sentry/utils/cjs/misc.js:27:15
at [Symbol.replace] (<anonymous>)
at String.replace (<anonymous>)
at Object.uuid4 (/my-project/node_modules/@sentry/core/node_modules/@sentry/utils/cjs/misc.js:25:46)
at Span.__init2 (/my-project/node_modules/@sentry/core/cjs/tracing/span.js:40:36)
at new Span (/my-project/node_modules/@sentry/core/cjs/tracing/span.js:107:53)
at Transaction.startChild (/my-project/node_modules/@sentry/core/cjs/tracing/span.js:156:23)
It appears to be related to this line: https://github.com/getsentry/sentry-javascript/blob/develop/packages/utils/src/misc.ts#L33
My guess is that Uint8Array
is not globally defined