@@ -125,8 +125,8 @@ Generating source maps consumes extra memory during the build process.
...
@@ -125,8 +125,8 @@ Generating source maps consumes extra memory during the build process.
You can disable source map generation by adding `productionBrowserSourceMaps: false` and `experimental.serverSourceMaps: false` to your Next.js configuration.
You can disable source map generation by adding `productionBrowserSourceMaps: false` and `experimental.serverSourceMaps: false` to your Next.js configuration.
Next.js will use source maps by default during the prerender phase of `next build`.
Next.js will use source maps by default for errors during the prerender phase of `next build`, loading them when an error is first logged.
If you consistently encounter memory issues during that phase (after "Generating static pages"),
If you consistently encounter memory issues during that phase (after "Generating static pages") while many errors are logged,
you can try disabling source maps in that phase by adding `enablePrerenderSourceMaps: false` to your Next.js configuration.
you can try disabling source maps in that phase by adding `enablePrerenderSourceMaps: false` to your Next.js configuration.
> **Good to know**: Some plugins may turn on source maps and may require custom configuration to disable.
> **Good to know**: Some plugins may turn on source maps and may require custom configuration to disable.
The `enablePrerenderSourceMaps` option lets Node.js use existing source maps during the prerender phase of `next build`. When source maps are available, error stack traces point to the original source code. It defaults to `true`.
The `enablePrerenderSourceMaps` option lets Next.js use existing source maps for errors during the prerender phase of `next build`. When source maps are available, error stack traces point to the original source code. It defaults to `true`.
Source maps are read when an error is first logged, so builds without errors don't pay for loading them.
This option does not generate source maps. Webpack does not generate server source maps by default. To generate them when investigating prerender errors, use [`next build --debug-prerender`](/docs/app/api-reference/cli/next#debugging-prerender-errors).
This option does not generate source maps. Webpack does not generate server source maps by default. To generate them when investigating prerender errors, use [`next build --debug-prerender`](/docs/app/api-reference/cli/next#debugging-prerender-errors).
Disabling source maps during prerendering can reduce [build memory usage](/docs/app/guides/memory-usage#disable-source-maps), but makes prerendering errors harder to debug.
Disabling source maps during prerendering can reduce [build memory usage](/docs/app/guides/memory-usage#disable-source-maps) when many errors are logged, but makes prerendering errors harder to debug.