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
fix(nextjs): Remove usage of chalk to avoid runtime errors (#18010)
This is currently a bandaid fix to remove the `chalk` import statements
that break turbopack apps during runtime until we have more details how
this code gets bundled into production.
ref #17806closes#17691
@@ -165,9 +164,7 @@ export default function wrappingLoader(
165
164
if(!showedMissingAsyncStorageModuleWarning){
166
165
// eslint-disable-next-line no-console
167
166
console.warn(
168
-
`${chalk.yellow('warn')} - The Sentry SDK could not access the ${chalk.bold.cyan(
169
-
'RequestAsyncStorage',
170
-
)} module. Certain features may not work. There is nothing you can do to fix this yourself, but future SDK updates may resolve this.\n`,
167
+
"[@sentry/nextjs] The Sentry SDK could not access the 'RequestAsyncStorage' module. Certain features may not work. There is nothing you can do to fix this yourself, but future SDK updates may resolve this.",
)} - Creating Sentry cron monitors for your Vercel Cron Jobs. You can disable this feature by setting the ${chalk.bold.cyan(
251
-
'automaticVercelMonitors',
252
-
)} option to false in you Next.js config.`,
247
+
"[@sentry/nextjs] Creating Sentry cron monitors for your Vercel Cron Jobs. You can disable this feature by setting the 'automaticVercelMonitors' option to false in you Next.js config.",
253
248
);
254
249
}
255
250
}
@@ -259,9 +254,7 @@ export function constructWebpackConfigFunction({
259
254
}else{
260
255
// log but noop
261
256
debug.error(
262
-
`${chalk.red(
263
-
'error',
264
-
)} - Sentry failed to read vercel.json for automatic cron job monitoring instrumentation`,
257
+
'[@sentry/nextjs] Failed to read vercel.json for automatic cron job monitoring instrumentation',
265
258
e,
266
259
);
267
260
}
@@ -344,11 +337,7 @@ export function constructWebpackConfigFunction({
344
337
){
345
338
// eslint-disable-next-line no-console
346
339
console.log(
347
-
`${chalk.yellow(
348
-
'warn',
349
-
)} - It seems like you don't have a global error handler set up. It is recommended that you add a ${chalk.cyan(
350
-
'global-error.js',
351
-
)} file with Sentry instrumentation so that React rendering errors are reported to Sentry. Read more: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#react-render-errors-in-app-router (you can suppress this warning by setting SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING=1 as environment variable)`,
340
+
"[@sentry/nextjs] It seems like you don't have a global error handler set up. It is recommended that you add a 'global-error.js' file with Sentry instrumentation so that React rendering errors are reported to Sentry. Read more: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#react-render-errors-in-app-router (you can suppress this warning by setting SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING=1 as environment variable)",
352
341
);
353
342
showedMissingGlobalErrorWarningMsg=true;
354
343
}
@@ -541,9 +530,7 @@ function warnAboutMissingOnRequestErrorHandler(instrumentationFile: string | nul
'[@sentry/nextjs] Could not find a Next.js instrumentation file. This indicates an incomplete configuration of the Sentry SDK. An instrumentation file is required for the Sentry SDK to be initialized on the server: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#create-initialization-config-files (you can suppress this warning by setting SENTRY_SUPPRESS_INSTRUMENTATION_FILE_WARNING=1 as environment variable)',
546
-
),
533
+
'[@sentry/nextjs] Could not find a Next.js instrumentation file. This indicates an incomplete configuration of the Sentry SDK. An instrumentation file is required for the Sentry SDK to be initialized on the server: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#create-initialization-config-files (you can suppress this warning by setting SENTRY_SUPPRESS_INSTRUMENTATION_FILE_WARNING=1 as environment variable)',
547
534
);
548
535
}
549
536
return;
@@ -552,9 +539,7 @@ function warnAboutMissingOnRequestErrorHandler(instrumentationFile: string | nul
'[@sentry/nextjs] Could not find `onRequestError` hook in instrumentation file. This indicates outdated configuration of the Sentry SDK. Use `Sentry.captureRequestError` to instrument the `onRequestError` hook: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#errors-from-nested-react-server-components',
557
-
),
542
+
'[@sentry/nextjs] Could not find `onRequestError` hook in instrumentation file. This indicates outdated configuration of the Sentry SDK. Use `Sentry.captureRequestError` to instrument the `onRequestError` hook: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#errors-from-nested-react-server-components',
0 commit comments