You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Critical dependency warning with require-in-the-middle after upgrading to Sentry 8.52.0 in Next.js app #15209
No critical dependency warnings during development server startup.
Actual Result
⚠ ./node_modules/.pnpm/require-in-the-middle@7.5.0/node_modules/require-in-the-middle/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
Import trace for requested module:
./node_modules/.pnpm/require-in-the-middle@7.5.0/node_modules/require-in-the-middle/index.js
./node_modules/.pnpm/@opentelemetry+instrumentation@0.56.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentation.js
./node_modules/.pnpm/@opentelemetry+instrumentation@0.56.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/index.js
./node_modules/.pnpm/@opentelemetry+instrumentation@0.56.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/instrumentation/build/esm/platform/index.js
./node_modules/.pnpm/@opentelemetry+instrumentation@0.56.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/instrumentation/build/esm/index.js
./node_modules/.pnpm/@sentry+opentelemetry@8.52.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.30.1_@opentelemet_usgluomwp3va5k3mad5pbwdxfm/node_modules/@sentry/opentelemetry/build/cjs/index.js
./node_modules/.pnpm/@sentry+nextjs@8.52.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemetry+ins_fvm7vkuyikfkbj6gbt6uu4g4sq/node_modules/@sentry/nextjs/build/cjs/server/index.js
./node_modules/.pnpm/@sentry+nextjs@8.52.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemetry+ins_fvm7vkuyikfkbj6gbt6uu4g4sq/node_modules/@sentry/nextjs/build/cjs/index.server.js
Reacted by Lukas Jakob Hafner, Jamie McElwain, Daniil, Scorpi, Júlio César Wandekoken, tracy, Clément Janssens, Florian Gyger, Rob Reiss, Kurk Villanueva and 28 more
Hi, we'll resolve this warning with the next release!
Reacted by Daniel Koller , William Mandai, Florian Gyger, Jarrod Ramsey, Ben Yee, Dennis Antela Martinez, Siebe Baree, Daniel C. Bucher, some1chan, Anh Tu Do and 6 more
Since upgrading to @sentry/nextjs@8.52.0, I’m encountering the same "require-in-the-middle" Critical Dependency Warning in Next.js. I saw that you mentioned a fix is planned for the next release.
For the interim solution, could you clarify: 1️⃣ Which is the latest stable release that does not have this issue? Should we downgrade to @sentry/nextjs@8.51.0, or is there a better version? 2️⃣ Would you recommend suppressing the warning using "ignoreWarnings" in next.config.js, or is downgrading a better approach? 3️⃣ What’s the estimated timeline for the fix in the next release?
Thanks in advance for your help! (cc: @getsantry @danielkoller)
Activity
lforst commentedon Jan 29, 2025
Hi, we'll resolve this warning with the next release!
danielkoller commentedon Jan 29, 2025
Awesome, thanks @lforst!
sousounibajis commentedon Jan 30, 2025
Hi @lforst,
Since upgrading to @sentry/nextjs@8.52.0, I’m encountering the same "require-in-the-middle" Critical Dependency Warning in Next.js. I saw that you mentioned a fix is planned for the next release.
For the interim solution, could you clarify: 1️⃣ Which is the latest stable release that does not have this issue? Should we downgrade to @sentry/nextjs@8.51.0, or is there a better version? 2️⃣ Would you recommend suppressing the warning using "ignoreWarnings" in next.config.js, or is downgrading a better approach? 3️⃣ What’s the estimated timeline for the fix in the next release?
Thanks in advance for your help! (cc: @getsantry @danielkoller)
102 remaining items
haydnjm commentedon May 5, 2025
Never mind - my issue was related to my usage of withSentryConfig. Fixed that up and I'm not getting the warning anymore.
tkodev commentedon May 8, 2025
How did you fix it?
chaodonghu commentedon May 8, 2025
@haydnjm Can you clarify how you fixed it? I'm getting the same error right now as wellUpdate: Just following up on this the errors in the development console can be fixed through configuring the
next.config.jsfilenext.config.js
I also installed
require-in-the-middleas a devDepenency and it seemed to solve the issue in both our e2e tests and CI/CD pipelinepackage.json
chargome commentedon May 14, 2025
If you still encounter this issue please review the troubleshooting steps in our documentation or check this issue history for additional solutions and workarounds.