Skip to content

_scope.setSDKProcessingMetadata is not a function #6198

Closed
@BenGale

Description

@BenGale

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.19.0

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

I've installed the latest @sentry/node package at version 7.19.0.
Followed the setup guides which don't seem to have changed since I was using the old version and this all works before.

Expected Result

The app not to explode.

Actual Result

The app explodes when a request is made with the following error:

TypeError: _scope.setSDKProcessingMetadata is not a function
    at /app/node_modules/@sentry/node/cjs/handlers.js:249:16
        -> /app/node_modules/@sentry/src/handlers.ts:280:1
    at Hub.withScope (/app/node_modules/@sentry/hub/dist/hub.js:85:13)
        -> /app/node_modules/@sentry/hub/src/hub.ts:154:7
    at Object.withScope (/app/node_modules/@sentry/core/cjs/exports.js:143:23)
        -> /app/node_modules/@sentry/src/exports.ts:157:1
    at sentryErrorMiddleware (/app/node_modules/@sentry/node/cjs/handlers.js:245:12)
        -> /app/node_modules/@sentry/src/handlers.ts:276:1
    at /app/node_modules/@sentry/tracing/cjs/integrations/node/express.js:122:12
        -> /app/node_modules/src/integrations/node/express.ts:191:1
    at Layer.handle_error (/app/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:315:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at Function.process_params (/app/node_modules/@sentry/tracing/cjs/integrations/node/express.js:273:34)
        -> /app/node_modules/src/integrations/node/express.ts:342:1
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/app/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:315:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at Function.process_params (/app/node_modules/@sentry/tracing/cjs/integrations/node/express.js:273:34)
        -> /app/node_modules/src/integrations/node/express.ts:342:1
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:97:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at Function.process_params (/app/node_modules/@sentry/tracing/cjs/integrations/node/express.js:273:34)
        -> /app/node_modules/src/integrations/node/express.ts:342:1
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/app/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)

I can get rid of the error if I remove this line during the sentry setup:
app.use(Sentry.Handlers.requestHandler());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions