Skip to content

Commit

Permalink
Add require-in-the-middle to default externals (#70922)
Browse files Browse the repository at this point in the history
Closes PACK-3288
Closes #70424

Sentry uses `open-telemetry`, which uses `require-in-the-middle` which:
- overrides the global `Module.prototype.require`, even when bundled
- reads `require.cache` which when bundled is Turbopack's registry (not
the outer Node.js one)


Because of this, `require-in-the-middle` is broken/results in a broken
environment when it's bundled (e.g. via `instrumentation.js`).
  • Loading branch information
mischnic authored Oct 7, 2024
1 parent c9c94c5 commit 37ea26b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Next.js includes a [short list of popular packages](https://github.com/vercel/ne
- `prisma`
- `puppeteer-core`
- `puppeteer`
- `require-in-the-middle`
- `rimraf`
- `sharp`
- `shiki`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Next.js includes a [short list of popular packages](https://github.com/vercel/ne
- `prisma`
- `puppeteer-core`
- `puppeteer`
- `require-in-the-middle`
- `rimraf`
- `sharp`
- `shiki`
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/lib/server-external-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"prisma",
"puppeteer",
"puppeteer-core",
"require-in-the-middle",
"rimraf",
"sharp",
"shiki",
Expand Down

0 comments on commit 37ea26b

Please sign in to comment.