Skip to content

Commit 5ce4435

Browse files
authored
fix(nextjs): Don't use chalk in turbopack config file (#17806)
We don't know yet why but this config code seems to be evaluated once at runtime for some users when using turbopack. The chalk import breaks with `Failed to load external module @sentry/nextjs: Error [ERR_REQUIRE_ESM]`. Just getting rid of this import for now to not break apps. We're still investigating together with Vercel why this this code gets pulled in. closes #17691
1 parent 22f8e5a commit 5ce4435

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/nextjs/src/config/turbopack/constructTurbopackConfig.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { debug } from '@sentry/core';
2-
import * as chalk from 'chalk';
32
import type { RouteManifest } from '../manifest/types';
43
import type { NextConfigObject, TurbopackMatcherWithRule, TurbopackOptions } from '../types';
54
import { generateValueInjectionRules } from './generateValueInjectionRules';
@@ -57,9 +56,7 @@ export function safelyAddTurbopackRule(
5756
// If the rule already exists, we don't want to mess with it.
5857
if (existingRules[matcher]) {
5958
debug.log(
60-
`${chalk.cyan(
61-
'info',
62-
)} - Turbopack rule already exists for ${matcher}. Please remove it from your Next.js config in order for Sentry to work properly.`,
59+
`[@sentry/nextjs] - Turbopack rule already exists for ${matcher}. Please remove it from your Next.js config in order for Sentry to work properly.`,
6360
);
6461
return existingRules;
6562
}

0 commit comments

Comments
 (0)