Skip to content

Next.js SDK not injected in dev mode #6321

@larsqa

Description

@larsqa

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.21.0

Framework Version

Next.js v12.3.0

Link to Sentry event

No response

Steps to Reproduce

In a sentry.server.config.js, use the beforeSend:

Sentry.init({
   ...
    beforeSend(event) {
        console.log("SENTRY EVENT");
        return event;
    },
});

Expected Result

The console log of "SENTRY EVENT" doesn't show up in the terminal.
Using the same method in a sentry.client.config.js does, however, trigger the console log in the browser's console.

Actual Result

I'm uncertain if this is intended or neglected. It seems that the client and server use different config SDK's.
I was only able to find the type definition of beforeSend in the client config, not server config.

Metadata

Metadata

Assignees

Labels

Package: nextjsIssues related to the Sentry Nextjs SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions