Skip to content

TypeError: Cannot convert undefined or null to object #5501

Description

@P4sca1

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/node

SDK Version

7.8.0

Framework Version

express 5.0.0-beta.1

Link to Sentry event

No response

Steps to Reproduce

After ugprading @sentry/integrations, @sentry/node, and @sentry/tracing from version 7.7.0 to 7.8.0, my application no longer starts up.

/** * Initializes Sentry. * @see {@link https://docs.sentry.io/platforms/node/} * * @param app - the Express.js app. Used to configure the Sentry-Express integration. */exportfunctioninitSentry(app: Express){constenv=process.env.SENTRY_ENV||process.env.NODE_ENV||'development'constversion=process.env.PACKAGE_VERSIONSentry.init({dsn: 'xxx',release: version ? `api@${version}` : undefined,environment: env,integrations: [newDedupe(),newRewriteFrames({ root }),newSentry.Integrations.Http({breadcrumbs: true,tracing: true}),newIntegrations.Express({ app }),newIntegrations.Prisma({client: prisma}),],beforeBreadcrumb: (breadcrumb)=>{// Filter out writes to apollographql use reporting API, because they are not helpful for error tracing// and spam breadcrumbs.if(breadcrumb.type==='http'&&typeofbreadcrumb.data?.url==='string'&&breadcrumb.data.url.includes('usage-reporting.api.apollographql.com')){returnnull}returnbreadcrumb},tracesSampleRate: 0.25,})}

Expected Result

It should continue to work as in version 7.7.0.

Actual Result

TypeError: Cannot convert undefined or null to object
at Function.getPrototypeOf (<anonymous>)
at instrumentRouter (omitted/node_modules/@sentry/tracing/cjs/integrations/node/express.js:195:28)
at Express.setupOnce (omitted/node_modules/@sentry/tracing/cjs/integrations/node/express.js:48:5)
at omitted/node_modules/@sentry/src/integration.ts:68:1
at Array.forEach (<anonymous>)
at Object.setupIntegrations (omitted/node_modules/@sentry/src/integration.ts:64:1)
at NodeClient.setupIntegrations (omitted/node_modules/@sentry/src/baseclient.ts:258:1)
at Hub.bindClient (omitted/node_modules/@sentry/src/hub.ts:123:1)
at Object.initAndBind (omitted/node_modules/@sentry/src/sdk.ts:35:1)
at Object.init (omitted/node_modules/@sentry/node/cjs/sdk.js:148:8)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions