Skip to content

Commit

Permalink
docs(js): Add troubleshooting section for pnpm (#11931)
Browse files Browse the repository at this point in the history
  • Loading branch information
chargome authored Nov 25, 2024
1 parent 222fb5b commit 4862728
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/platforms/javascript/common/troubleshooting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,29 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
</Expandable>
</PlatformSection>
<Expandable permalink title="pnpm: Resolving 'import-in-the-middle' external package errors">
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
```
<Alert level="warning">
**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.
</Alert>
</Expandable>
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 comments on commit 4862728

Please sign in to comment.