Skip to content

Commit

Permalink
ref(nextjs): Improve wording in case CLI is missing (#9538)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored Nov 13, 2023
1 parent 04e7be9 commit 569e5b5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const RUNTIME_TO_SDK_ENTRYPOINT_MAP = {
let showedMissingAuthTokenErrorMsg = false;
let showedMissingOrgSlugErrorMsg = false;
let showedMissingProjectSlugErrorMsg = false;
let showedMissingCLiBinaryErrorMsg = false;
let showedHiddenSourceMapsWarningMsg = false;

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

// @ts-expect-error - this exists, the dynamic import just doesn't know it
if (!SentryWebpackPlugin || !SentryWebpackPlugin.cliBinaryExists()) {
// eslint-disable-next-line no-console
console.error(
`${chalk.red('error')} - ${chalk.bold('Sentry CLI binary not found.')} Source maps will not be uploaded.\n`,
);
if (!showedMissingCLiBinaryErrorMsg) {
// eslint-disable-next-line no-console
console.error(
`${chalk.red('error')} - ${chalk.bold(
'Sentry CLI binary not found.',
)} 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`,
);
showedMissingCLiBinaryErrorMsg = true;
}
return false;
}

Expand Down

0 comments on commit 569e5b5

Please sign in to comment.