Skip to content

Commit 49f334f

Browse files
author
Luca Forstner
committed
Only show message when crons field is defined
1 parent 9d18786 commit 49f334f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,15 @@ export function constructWebpackConfigFunction(
169169
if (process.env.VERCEL && userSentryOptions.automaticVercelMonitors !== false) {
170170
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
171171
vercelCronsConfig = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'vercel.json'), 'utf8')).crons;
172-
logger.info(
173-
`${chalk.cyan(
174-
'info',
175-
)} - Creating Sentry cron monitors for your Vercel Cron Jobs. You can disable this feature by setting the ${chalk.bold.cyan(
176-
'automaticVercelMonitors',
177-
)} option to false in you Next.js config.`,
178-
);
172+
if (vercelCronsConfig) {
173+
logger.info(
174+
`${chalk.cyan(
175+
'info',
176+
)} - Creating Sentry cron monitors for your Vercel Cron Jobs. You can disable this feature by setting the ${chalk.bold.cyan(
177+
'automaticVercelMonitors',
178+
)} option to false in you Next.js config.`,
179+
);
180+
}
179181
}
180182
} catch (e) {
181183
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access

0 commit comments

Comments
 (0)