Skip to content

Commit 9e13e6a

Browse files
committed
add troubleshooting for oom
1 parent b195a9b commit 9e13e6a

File tree

1 file changed

+36
-14
lines changed
  • docs/platforms/javascript/common/troubleshooting

1 file changed

+36
-14
lines changed

docs/platforms/javascript/common/troubleshooting/index.mdx

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -431,29 +431,32 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
431431
432432
</Expandable>
433433
434-
435434
</PlatformSection>
436435
437436
<PlatformSection notSupported={['javascript.nuxt']}>
438437
<Expandable permalink title="pnpm: Resolving 'import-in-the-middle' external package errors">
439438
440-
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.
439+
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.
441440
442-
While adding these packages as direct dependencies might remove the warning messages, it often doesn't resolve the underlying functionality issues:
441+
While adding these packages as direct dependencies might remove the warning messages, it often doesn't resolve the underlying functionality issues:
443442
444-
```bash
445-
pnpm add import-in-the-middle require-in-the-middle
446-
```
443+
```bash
444+
pnpm add import-in-the-middle require-in-the-middle
445+
```
447446
448-
As a workaround, create or modify `.npmrc` in your project root:
447+
As a workaround, create or modify `.npmrc` in your project root:
449448
450-
```npmrc
451-
shamefully-hoist=true
452-
```
453-
<Alert level="warning">
454-
**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.
455-
</Alert>
449+
```npmrc
450+
shamefully-hoist=true
451+
```
456452
453+
{" "}
454+
<Alert level="warning">
455+
**Note**: While `shamefully-hoist=true` usually isn't the ideal solution from
456+
a dependency management perspective, it's sometimes necessary for
457+
compatibility with certain packages that expect Node.js module resolution
458+
behavior similar to npm or yarn.
459+
</Alert>
457460
458461
</Expandable>
459462
</PlatformSection>
@@ -464,7 +467,6 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
464467
`Failed to register ESM hook import-in-the-middle/hook.mjs`. You can add an override (npm/pnpm) or a resolution (yarn)
465468
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).
466469
467-
468470
Nitro updated `@vercel/nft` in Nitro version `2.10.0`, so you might not get this error anymore, and you don't need to
469471
add this override/resolution.
470472
@@ -500,6 +502,7 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
500502
```bash
501503
pnpm add import-in-the-middle
502504
```
505+
503506
</Expandable>
504507
505508
<Expandable permalink title="Nuxt: Server-side Nitro is not sending events">
@@ -537,6 +540,25 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
537540
}
538541
}
539542
```
543+
544+
</Expandable>
545+
</PlatformSection>
546+
547+
<PlatformSection supported={['javascript.nextjs']}>
548+
<Expandable permalink title="Out of Memory (OOM) errors during build">
549+
The problem is related to memory consumption during the build process, especially when generating source maps. Here are some potential solutions and workarounds:
550+
551+
- Update your `@sentry/nextjs` package to the latest version.
552+
- 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`
553+
- Disable source maps entirely: As a last resort, you can disable source map generation completely:
554+
```js {filename:next.config.js}
555+
module.exports = withSentryConfig(module.exports, {
556+
sourcemaps: {
557+
disable: true,
558+
},
559+
}
560+
```
561+
540562
</Expandable>
541563
</PlatformSection>
542564

0 commit comments

Comments
 (0)