Skip to content

Commit b5d96eb

Browse files
committed
rm chalk
1 parent 152b9d4 commit b5d96eb

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

packages/nextjs/src/config/loaders/wrappingLoader.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import commonjs from '@rollup/plugin-commonjs';
22
import { stringMatchesSomePattern } from '@sentry/core';
3-
import * as chalk from 'chalk';
43
import * as fs from 'fs';
54
import * as path from 'path';
65
import type { RollupBuild, RollupError } from 'rollup';
@@ -165,9 +164,7 @@ export default function wrappingLoader(
165164
if (!showedMissingAsyncStorageModuleWarning) {
166165
// eslint-disable-next-line no-console
167166
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.",
171168
);
172169
showedMissingAsyncStorageModuleWarning = true;
173170
}

packages/nextjs/src/config/webpack.ts

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/* eslint-disable max-lines */
33

44
import { debug, escapeStringForRegex, loadModule, parseSemver } from '@sentry/core';
5-
import * as chalk from 'chalk';
65
import * as fs from 'fs';
76
import * as path from 'path';
87
import { sync as resolveSync } from 'resolve';
@@ -245,11 +244,7 @@ export function constructWebpackConfigFunction({
245244
vercelCronsConfig = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'vercel.json'), 'utf8')).crons;
246245
if (vercelCronsConfig) {
247246
debug.log(
248-
`${chalk.cyan(
249-
'info',
250-
)} - 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.",
253248
);
254249
}
255250
}
@@ -259,9 +254,8 @@ export function constructWebpackConfigFunction({
259254
} else {
260255
// log but noop
261256
debug.error(
262-
`${chalk.red(
263-
'error',
264-
)} - Sentry failed to read vercel.json for automatic cron job monitoring instrumentation`,
257+
'error',
258+
'Sentry failed to read vercel.json for automatic cron job monitoring instrumentation',
265259
e,
266260
);
267261
}
@@ -344,11 +338,7 @@ export function constructWebpackConfigFunction({
344338
) {
345339
// eslint-disable-next-line no-console
346340
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)`,
341+
"[@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)",
352342
);
353343
showedMissingGlobalErrorWarningMsg = true;
354344
}
@@ -541,9 +531,7 @@ function warnAboutMissingOnRequestErrorHandler(instrumentationFile: string | nul
541531
if (!process.env.SENTRY_SUPPRESS_INSTRUMENTATION_FILE_WARNING) {
542532
// eslint-disable-next-line no-console
543533
console.warn(
544-
chalk.yellow(
545-
'[@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-
),
534+
'[@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)',
547535
);
548536
}
549537
return;
@@ -552,9 +540,7 @@ function warnAboutMissingOnRequestErrorHandler(instrumentationFile: string | nul
552540
if (!instrumentationFile.includes('onRequestError')) {
553541
// eslint-disable-next-line no-console
554542
console.warn(
555-
chalk.yellow(
556-
'[@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-
),
543+
'[@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',
558544
);
559545
}
560546
}

0 commit comments

Comments
 (0)