Is there an existing issue for this?
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.ts at the line with console.log("Add a breakpoint here")
src/app/api/test/route.ts at the lines with console.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.ts at the line with console.log("Add a breakpoint here")
src/app/api/test/route.ts at the lines with console.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
Is there an existing issue for this?
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
withSentryConfiginnext.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)
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")Test Case 2: With Sentry (Breakpoints Do Not Work)
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")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