Conversation
Contributor
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes debugger breakpoint support in development mode for Next.js server-side code by generating inline sourcemaps in the wrapping loader. The changes ensure that IDEs like VSCode and Cursor can correctly map breakpoints back to the original source files for server components, API routes, middleware, and other server-side code.
- Adds
isDevparameter to wrapping loader options and passes it through webpack configuration - Modifies sourcemap generation to use inline sourcemaps in dev mode and hidden sourcemaps in production
- Implements absolute path preservation in dev mode sourcemaps to ensure correct breakpoint resolution
- Adds test coverage for both dev and production sourcemap behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/nextjs/src/config/webpack.ts | Adds isDev flag to staticWrappingLoaderOptions to pass development mode state to the wrapping loader |
| packages/nextjs/src/config/loaders/wrappingLoader.ts | Implements inline sourcemap generation for dev mode, including logic to preserve absolute paths and create identity mappings when no sourcemap exists |
| packages/nextjs/test/config/wrappingLoader.test.ts | Adds test coverage for inline sourcemap presence in dev mode and absence in production mode |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jan 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes breakpoints for editors like VSCode/Cursor in server-side code.
I have verified that breakpoints work in:
This only affects webpack, and doesn't change anything for prod builds.
closes #17088