diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index d619e0543cfcdd..3359fe321c775c 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -431,6 +431,29 @@ 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. + +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 +``` + +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. + + + + + 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.