Skip to content

Commit

Permalink
Only show message when crons field is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed May 10, 2023
1 parent 9d18786 commit 49f334f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,15 @@ export function constructWebpackConfigFunction(
if (process.env.VERCEL && userSentryOptions.automaticVercelMonitors !== false) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
vercelCronsConfig = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'vercel.json'), 'utf8')).crons;
logger.info(
`${chalk.cyan(
'info',
)} - Creating Sentry cron monitors for your Vercel Cron Jobs. You can disable this feature by setting the ${chalk.bold.cyan(
'automaticVercelMonitors',
)} option to false in you Next.js config.`,
);
if (vercelCronsConfig) {
logger.info(
`${chalk.cyan(
'info',
)} - Creating Sentry cron monitors for your Vercel Cron Jobs. You can disable this feature by setting the ${chalk.bold.cyan(
'automaticVercelMonitors',
)} option to false in you Next.js config.`,
);
}
}
} catch (e) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Expand Down

0 comments on commit 49f334f

Please sign in to comment.