-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
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/nextjs
SDK Version
9.40.0
Framework Version
Next 15.0.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
https://github.com/HeroJourneyClub/WithSentryDebugger/tree/master
Issue Description
When using Sentry's withSentryConfig in next.config.mjs, breakpoints set in both the middleware (src/middleware.ts) and API routes don't work. This can be demonstrated using two different launch configurations.
Steps to Reproduce
How to Test
Test Case 1: Without Sentry (Breakpoints Work)
- In VS Code, select the "WITHOUT SENTRY: debug server-side" configuration
- Start debugging (F5)
- Set breakpoints in:
src/middleware.tsat the line withconsole.log("Add a breakpoint here")src/app/api/test/route.tsat the lines withconsole.log("Add a breakpoint here")
- Visit http://localhost:3000 and click either the "Test GET Request" or "Test POST Request" button
- Observe that all breakpoints are hit and debugging works as expected
Test Case 2: With Sentry (Breakpoints Do Not Work)
- In VS Code, select the "WITH SENTRY: debug server-side" configuration
- Start debugging (F5)
- Set breakpoints in:
src/middleware.tsat the line withconsole.log("Add a breakpoint here")src/app/api/test/route.tsat the lines withconsole.log("Add a breakpoint here")
- Visit http://localhost:3000 and click either the "Test GET Request" or "Test POST Request" button
- Observe that none of the breakpoints are hit (although the console.log outputs appear in the terminal)
VS Code Launch Configuration
The repository includes the following launch configuration in .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "WITH SENTRY: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev",
"env": {
"WITH_SENTRY": "true"
}
},
{
"name": "WITHOUT SENTRY: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev",
"env": {
"WITH_SENTRY": "false"
}
}
]
}Expected Result
Breakpoints are working
Actual Result
Breakpoints are not working
mschmidm
Metadata
Metadata
Assignees
Labels
Projects
Status
No status