next.js
57c8d04b - Create unique source URLs between Client and Server in Pages dir (#75878)

Commit
1 year ago
Create unique source URLs between Client and Server in Pages dir (#75878) This ensures we don't accidentally return the sourcemap for the server code of a given file when a stackframe was created in the browser. The Server vs Client case could be distinguished separately but not if we're dealing with externals in Edge and Node.js. We have to use the native `findSourceMap` for those case. There's probably a valid factoring where we ask the correct compilation to avoid ambiguity but the bundler is really just a perf optimization. E.g. in `next start` and prerender of `next build` we don't have access to the bundler so native `findSourceMap` has to work. It's not needed for Turbopack since source URLs are already unique it seems. The actual test is in https://github.com/vercel/next.js/pull/75863 which wouldn't work without this change.
Author
Parents
Loading