Skip to content

Commit f4dbaca

Browse files
committed
add log for existing matcher
1 parent 16eb903 commit f4dbaca

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1+
import { logger } from '@sentry/core';
2+
import * as chalk from 'chalk';
13
import * as path from 'path';
24
import type { RouteManifest } from '../manifest/types';
3-
import type {
4-
NextConfigObject,
5-
SentryBuildOptions,
6-
TurbopackOptions,
7-
TurbopackRuleConfigItemOrShortcut,
8-
} from '../types';
5+
import type { NextConfigObject, TurbopackOptions, TurbopackRuleConfigItemOrShortcut } from '../types';
96

107
/**
118
* Construct a Turbopack config object from a Next.js config object and a Turbopack options object.
@@ -66,6 +63,11 @@ export function safelyAddTurbopackRule(
6663

6764
// If the rule already exists, we don't want to mess with it.
6865
if (existingRules[matcher]) {
66+
logger.info(
67+
`${chalk.cyan(
68+
'info',
69+
)} - Turbopack rule already exists for ${matcher}. Please remove it from your Next.js config in order for Sentry to work properly.`,
70+
);
6971
return existingRules;
7072
}
7173

0 commit comments

Comments
 (0)