Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(nextjs): Improve wording in case CLI is missing #9538

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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