diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index fef140d8392ad..40143b02f353e 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -431,7 +431,6 @@ Learn more about fixing these caching issues in the **Note**: While `shamefully-hoist=true` usually isn't the ideal solution from a dependency management perspective, it's sometimes necessary for compatibility with certain packages that expect Node.js module resolution behavior similar to npm or yarn. - @@ -464,7 +463,6 @@ shamefully-hoist=true `Failed to register ESM hook import-in-the-middle/hook.mjs`. You can add an override (npm/pnpm) or a resolution (yarn) for `@vercel/nft` to fix this. This will add the `hook.mjs` file to your build output. See the [underlying issue in the UnJS Nitro project](https://github.com/unjs/nitro/issues/2703). - Nitro updated `@vercel/nft` in Nitro version `2.10.0`, so you might not get this error anymore, and you don't need to add this override/resolution. @@ -500,6 +498,7 @@ shamefully-hoist=true ```bash pnpm add import-in-the-middle ``` + @@ -537,6 +536,25 @@ shamefully-hoist=true } } ``` + + + + + + + The problem here is related to memory consumption during the build process, especially when generating source maps. Here are some potential solutions and workarounds: + + - Update your `@sentry/nextjs` package to the latest version. + - Increase Node.js memory limit: You can try increasing the memory limit for Node.js during the build process. Add this to your build command: `NODE_OPTIONS="--max-old-space-size=8192" next build`. This flag will increase the memory available to the node process to 8 GB. We have found that Next.js consumes around 4 GB in most cases. Decrease the size depending on your memory availability. + - Disable source maps entirely: As a last resort, you can disable source map generation completely: + ```js {filename:next.config.js} + module.exports = withSentryConfig(module.exports, { + sourcemaps: { + disable: true, + }, + } + ``` +