Next.js SDK not injected in dev mode
See original GitHub issueIs 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 package are you using?
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.
Issue Analytics
- State:
- Created 10 months ago
- Comments:23 (11 by maintainers)
Top Results From Across the Web
Basic Features: Handling Scripts - Next.js
The Script component solves these problems by providing a declarative API for loading third-party scripts. It provides a set of built-in loading strategies ......
Read more >sentry/nextjs not working on server · Issue #3691 - GitHub
My app does indeed start, and everything looks normal. One thing to note: in dev mode, when NODE_ENV !== 'production' , i do...
Read more >nextjs - use _error.js in dev mode - Stack Overflow
When I build with as a production env, no problem, my custom error page is picked up. Any idea on how to render...
Read more >Walkthrough: Connecting the Next.js application directly to the ...
Set up your local front-end development on operating systems that don't support Windows containers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok we just released
7.22.0
can you check whether it resolves this issue?Yeah there’s no clear cut way where to look for it. It all depends on how you set up the SDK. PII might be everywhere - breadcrumbs, in the error messages, even in stack traces sometimes. We recommend being careful when handling data like that.
We’ll probably release it as a minor.