---
title: enablePrerenderSourceMaps
description: Enable source maps for errors during prerendering in next build.
url: "https://nextjs.org/docs/app/api-reference/config/next-config-js/enablePrerenderSourceMaps"
docs_index: /docs/llms.txt
version: 16.4.0
lastUpdated: 2026-09-29
prerequisites:
  - "Configuration: /docs/app/api-reference/config"
  - "next.config.js: /docs/app/api-reference/config/next-config-js"
related:
  - app/guides/memory-usage
  - app/api-reference/config/next-config-js/productionBrowserSourceMaps
---


> For an index of all Next.js documentation, see [/docs/llms.txt](/docs/llms.txt).
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`.

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).

To disable it, set `enablePrerenderSourceMaps` to `false`:

```ts filename="next.config.ts" switcher highlight={4}
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  enablePrerenderSourceMaps: false,
}

export default nextConfig
```

```js filename="next.config.js" switcher highlight={3}
/** @type {import('next').NextConfig} */
const nextConfig = {
  enablePrerenderSourceMaps: false,
}

module.exports = nextConfig
```

## Reference

| Option                      | Type      | Default |
| --------------------------- | --------- | ------- |
| `enablePrerenderSourceMaps` | `boolean` | `true`  |

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.

## Version History

| Version   | Changes                                                                                                                              |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `v16.3.0` | The default changed to `true`, regardless of whether `cacheComponents` is enabled.                                                   |
| `v16.0.0` | `enablePrerenderSourceMaps` moved from `experimental.enablePrerenderSourceMaps` to the top-level `enablePrerenderSourceMaps` option. |
- [Memory Usage](/docs/app/guides/memory-usage)
  - Optimize memory used by your application in development and production.
- [productionBrowserSourceMaps](/docs/app/api-reference/config/next-config-js/productionBrowserSourceMaps)
  - Enables browser source map generation during the production build.

---

For a semantic overview of all documentation, see [/docs/sitemap.md](/docs/sitemap.md)

For an index of all available documentation, see [/docs/llms.txt](/docs/llms.txt)