From 9e13e6a24b2a847eecf87bc3d20e058e9f66d69a Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Wed, 11 Dec 2024 14:33:49 +0100 Subject: [PATCH 1/4] add troubleshooting for oom --- .../common/troubleshooting/index.mdx | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index 9d416643be8d7..3e51db8245295 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -431,29 +431,32 @@ Learn more about fixing these caching issues in the - When using pnpm, you might encounter errors related to packages that can't be external, particularly with packages like `import-in-the-middle` and `require-in-the-middle`. These errors typically occur due to pnpm's strict dependency management and hoisting behavior. +When using pnpm, you might encounter errors related to packages that can't be external, particularly with packages like `import-in-the-middle` and `require-in-the-middle`. These errors typically occur due to pnpm's strict dependency management and hoisting behavior. - While adding these packages as direct dependencies might remove the warning messages, it often doesn't resolve the underlying functionality issues: +While adding these packages as direct dependencies might remove the warning messages, it often doesn't resolve the underlying functionality issues: - ```bash - pnpm add import-in-the-middle require-in-the-middle - ``` +```bash +pnpm add import-in-the-middle require-in-the-middle +``` - As a workaround, create or modify `.npmrc` in your project root: +As a workaround, create or modify `.npmrc` in your project root: - ```npmrc - shamefully-hoist=true - ``` - - **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. - +```npmrc +shamefully-hoist=true +``` +{" "} + + **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 +467,6 @@ Learn more about fixing these caching issues in the @@ -537,6 +540,25 @@ Learn more about fixing these caching issues in the + The problem 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=4096" next build` + - 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, + }, + } + ``` + From 06b3e5b56ec9f6197e9733ff390cca1981178def Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Wed, 11 Dec 2024 15:14:56 +0100 Subject: [PATCH 2/4] Update docs/platforms/javascript/common/troubleshooting/index.mdx Co-authored-by: Luca Forstner --- docs/platforms/javascript/common/troubleshooting/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index 3e51db8245295..7ecb83ecf06cf 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -549,7 +549,7 @@ shamefully-hoist=true The problem 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=4096" next build` + - 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, { From a780d752a4a2a02f08eddcfb67954bbc752c5fd6 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 12 Dec 2024 09:55:04 +0100 Subject: [PATCH 3/4] Update docs/platforms/javascript/common/troubleshooting/index.mdx Co-authored-by: Alex Krawiec --- docs/platforms/javascript/common/troubleshooting/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index a291c7f631827..b085a312ac752 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -550,7 +550,7 @@ shamefully-hoist=true - The problem is related to memory consumption during the build process, especially when generating source maps. Here are some potential solutions and workarounds: + 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. From ad7ad43f146365d1822d68b9fadd8a2cf993c4ee Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 12 Dec 2024 09:56:10 +0100 Subject: [PATCH 4/4] remove duplicate alert --- .../platforms/javascript/common/troubleshooting/index.mdx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index b085a312ac752..40143b02f353e 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -454,14 +454,6 @@ shamefully-hoist=true **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. -{" "} - - **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. - -