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
`[@sentry/nextjs] WARNING: You are using the Sentry SDK with Turbopack (\`next dev --turbo\`). The Sentry SDK is compatible with Turbopack on Next.js version 15.3.0 or later. You are currently on ${nextJsVersion}. Please upgrade to a newer Next.js version to use the Sentry SDK with Turbopack. Note that the SDK will continue to work for non-Turbopack production builds. This warning is only about dev-mode.`,
287
-
);
288
-
}elseif(process.env.NODE_ENV==='production'){
289
-
// eslint-disable-next-line no-console
290
-
console.warn(
291
-
`[@sentry/nextjs] WARNING: You are using the Sentry SDK with Turbopack (\`next build --turbo\`). The Sentry SDK is compatible with Turbopack on Next.js version 15.3.0 or later. You are currently on ${nextJsVersion}. Please upgrade to a newer Next.js version to use the Sentry SDK with Turbopack. Note that as Turbopack is still experimental for production builds, some of the Sentry SDK features like source maps will not work. Follow this issue for progress on Sentry + Turbopack: https://github.com/getsentry/sentry-javascript/issues/8105.`,
292
-
);
293
-
}
259
+
if(!isTurbopackSupported&&isTurbopack){
260
+
if(process.env.NODE_ENV==='development'){
261
+
// eslint-disable-next-line no-console
262
+
console.warn(
263
+
`[@sentry/nextjs] WARNING: You are using the Sentry SDK with Turbopack (\`next dev --turbopack\`). The Sentry SDK is compatible with Turbopack on Next.js version 15.4.1 or later. You are currently on ${nextJsVersion}. Please upgrade to a newer Next.js version to use the Sentry SDK with Turbopack.`,
264
+
);
265
+
}elseif(process.env.NODE_ENV==='production'){
266
+
// eslint-disable-next-line no-console
267
+
console.warn(
268
+
`[@sentry/nextjs] WARNING: You are using the Sentry SDK with Turbopack (\`next build --turbopack\`). The Sentry SDK is compatible with Turbopack on Next.js version 15.4.1 or later. You are currently on ${nextJsVersion}. Please upgrade to a newer Next.js version to use the Sentry SDK with Turbopack.`,
'[@sentry/nextjs] WARNING: You are using the Sentry SDK with Turbopack (`next dev --turbopack`). The Sentry SDK is compatible with Turbopack on Next.js version 15.4.1 or later. You are currently on 15.4.0. Please upgrade to a newer Next.js version to use the Sentry SDK with Turbopack.',
995
+
);
996
+
997
+
consoleWarnSpy.mockRestore();
998
+
});
999
+
1000
+
it('warns in production mode when Turbopack is enabled with unsupported Next.js version',()=>{
1001
+
process.env.TURBOPACK='1';
1002
+
// @ts-expect-error - NODE_ENV is read-only in types but we need to set it for testing
'[@sentry/nextjs] WARNING: You are using the Sentry SDK with Turbopack (`next build --turbopack`). The Sentry SDK is compatible with Turbopack on Next.js version 15.4.1 or later. You are currently on 15.3.9. Please upgrade to a newer Next.js version to use the Sentry SDK with Turbopack.',
1012
+
);
1013
+
1014
+
consoleWarnSpy.mockRestore();
1015
+
});
1016
+
1017
+
it('does not warn when Turbopack is enabled with supported Next.js version',()=>{
1018
+
process.env.TURBOPACK='1';
1019
+
// @ts-expect-error - NODE_ENV is read-only in types but we need to set it for testing
'[@sentry/nextjs] WARNING: You are using the Sentry SDK with Turbopack (`next dev --turbopack`). The Sentry SDK is compatible with Turbopack on Next.js version 15.4.1 or later. You are currently on 15.4.0-canary.15. Please upgrade to a newer Next.js version to use the Sentry SDK with Turbopack.',
1116
+
);
1117
+
1118
+
consoleWarnSpy.mockRestore();
1119
+
});
1120
+
1121
+
it('does not warn in other environments besides development and production',()=>{
1122
+
process.env.TURBOPACK='1';
1123
+
// @ts-expect-error - NODE_ENV is read-only in types but we need to set it for testing
0 commit comments