-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Critical dependency warning with require-in-the-middle after upgrading to Sentry 8.52.0 in Next.js app #15209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, we'll resolve this warning with the next release! |
Awesome, thanks @lforst! |
Hi @lforst, Since upgrading to @sentry/[email protected], 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/[email protected], 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) |
@sousounibajis just jumping in for Luca real quick:
|
Sorry for the troubles everyone! |
Hey, I'm getting the same error using
|
@colaquecez does 8.52.1 fix it for you? |
Hey @Lms24, it doesn't:
|
Having the same warning and none of the mentioned methods silenced it. Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
Import trace for requested module:
./node_modules/require-in-the-middle/index.js
./node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentation.js
./node_modules/@opentelemetry/instrumentation/build/esm/platform/node/index.js
./node_modules/@opentelemetry/instrumentation/build/esm/platform/index.js
./node_modules/@opentelemetry/instrumentation/build/esm/index.js
./node_modules/@sentry/node/build/cjs/otel/instrument.js
./node_modules/@sentry/node/build/cjs/index.js
./node_modules/@sentry/nextjs/build/cjs/index.server.js
./app/error.tsx |
@KarolisAntanas (or anyone else still affected by this error): Can you please provide a minimal reproduction? We tried reproducing this multiple times ourselves and couldn't do so. |
Never mind - my issue was related to my usage of withSentryConfig. Fixed that up and I'm not getting the warning anymore. |
How did you fix it? |
Update: Just following up on this the errors in the development console can be fixed through configuring the next.config.js
I also installed package.json
|
If you still encounter this issue please review the troubleshooting steps in our documentation or check this issue history for additional solutions and workarounds. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.52.0
Framework Version
React 19.0.0 & Next.js 15.1.6
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
Expected Result
No critical dependency warnings during development server startup.
Actual Result
The text was updated successfully, but these errors were encountered: