Skip to content

Commit d9d939c

Browse files
authored
Merge branch 'master' into cg/troubleshooting-next-oom
2 parents 06b3e5b + 887b408 commit d9d939c

File tree

1 file changed

+34
-0
lines changed
  • docs/platforms/javascript/common/troubleshooting

1 file changed

+34
-0
lines changed

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ As a workaround, create or modify `.npmrc` in your project root:
450450
shamefully-hoist=true
451451
```
452452
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>
456+
453457
{" "}
454458
<Alert level="warning">
455459
**Note**: While `shamefully-hoist=true` usually isn't the ideal solution from
@@ -562,4 +566,34 @@ shamefully-hoist=true
562566
</Expandable>
563567
</PlatformSection>
564568
569+
<PlatformSection supported={['javascript.nextjs']}>
570+
<Expandable permalink title="Using the Sentry Next SDK in a Nx monorepo (using `@nx/next`)">
571+
To set up Sentry's Next.js SDK in an Nx monorepo context, consider the following setup:
572+
573+
```js {filename:next.config.js}
574+
const nextConfig = {
575+
// ...
576+
};
577+
578+
const plugins = [
579+
// Your plugins excluding withNx
580+
];
581+
582+
module.exports = async (phase, context) => {
583+
let updatedConfig = plugins.reduce((acc, fn) => fn(acc), nextConfig);
584+
585+
// Apply the async function that `withNx` returns.
586+
updatedConfig = await withNx(updatedConfig)(phase, context);
587+
588+
return updatedConfig;
589+
};
590+
591+
// The Sentry plugin should always be applied last
592+
const { withSentryConfig } = require('@sentry/nextjs');
593+
module.exports = withSentryConfig(module.exports)
594+
```
595+
596+
</Expandable>
597+
</PlatformSection>
598+
565599
If you need additional help, you can [ask on GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose). Customers on a paid plan may also contact support.

0 commit comments

Comments
 (0)