Skip to content

Commit 4862728

Browse files
authored
docs(js): Add troubleshooting section for pnpm (#11931)
1 parent 222fb5b commit 4862728

File tree

1 file changed

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

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,29 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
431431
432432
</Expandable>
433433
434+
434435
</PlatformSection>
435436
437+
<Expandable permalink title="pnpm: Resolving 'import-in-the-middle' external package errors">
438+
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.
440+
441+
While adding these packages as direct dependencies might remove the warning messages, it often doesn't resolve the underlying functionality issues:
442+
443+
```bash
444+
pnpm add import-in-the-middle require-in-the-middle
445+
```
446+
447+
As a workaround, create or modify `.npmrc` in your project root:
448+
449+
```npmrc
450+
shamefully-hoist=true
451+
```
452+
<Alert level="warning">
453+
**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.
454+
</Alert>
455+
456+
457+
</Expandable>
458+
436459
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)