Skip to content

Commit 569e5b5

Browse files
authored
ref(nextjs): Improve wording in case CLI is missing (#9538)
1 parent 04e7be9 commit 569e5b5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/nextjs/src/config/webpack.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const RUNTIME_TO_SDK_ENTRYPOINT_MAP = {
3535
let showedMissingAuthTokenErrorMsg = false;
3636
let showedMissingOrgSlugErrorMsg = false;
3737
let showedMissingProjectSlugErrorMsg = false;
38+
let showedMissingCLiBinaryErrorMsg = false;
3839
let showedHiddenSourceMapsWarningMsg = false;
3940

4041
// TODO: merge default SentryWebpackPlugin ignore with their SentryWebpackPlugin ignore or ignoreFile
@@ -844,10 +845,15 @@ function shouldEnableWebpackPlugin(buildContext: BuildContext, userSentryOptions
844845

845846
// @ts-expect-error - this exists, the dynamic import just doesn't know it
846847
if (!SentryWebpackPlugin || !SentryWebpackPlugin.cliBinaryExists()) {
847-
// eslint-disable-next-line no-console
848-
console.error(
849-
`${chalk.red('error')} - ${chalk.bold('Sentry CLI binary not found.')} Source maps will not be uploaded.\n`,
850-
);
848+
if (!showedMissingCLiBinaryErrorMsg) {
849+
// eslint-disable-next-line no-console
850+
console.error(
851+
`${chalk.red('error')} - ${chalk.bold(
852+
'Sentry CLI binary not found.',
853+
)} Source maps will not be uploaded. Please check that postinstall scripts are enabled in your package manager when installing your dependencies and please run your build once without any caching to avoid caching issues of dependencies.\n`,
854+
);
855+
showedMissingCLiBinaryErrorMsg = true;
856+
}
851857
return false;
852858
}
853859

0 commit comments

Comments
 (0)