However, the Vercel build fails at the Sentry CLI step.
// eslint-disable-next-line
const { withSentryConfig } = require('@sentry/nextjs');
// eslint-disable-next-line
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
poweredByHeader: false,
swcMinify: true,
compiler: {
removeConsole: process.env.NODE_ENV === 'production',
},
},
typescript: {
ignoreBuildErrors: true,
},
sentry: {
hideSourceMaps: true,
},
};
const sentryWebpackPluginOptions = {
silent: true, // Suppresses all logs
setCommits: {
repo: 'username/repo',
auto: true,
ignoreMissing: true,
},
};
module.exports = withSentryConfig(
withBundleAnalyzer(nextConfig),
sentryWebpackPluginOptions
);
Expect to Vercel build to pass and to deploy.
- info - Creating an optimized production build...
- Failed to compile.
- Sentry CLI Plugin: Command failed: /vercel/path0/node_modules/@sentry/cli/sentry-cli releases set-commits 9a08b86b.....364bc5fd67f --auto --ignore-missing
- error: No commits found. Change commits range, initial depth or use --ignore-empty to allow empty patch sets.
- > Build failed because of webpack errors
- error Command failed with exit code 1.
- - Error! Command "yarn run build" exited with 1
Not sure if it's failing because my config is incorrect or because Next.js using SWC as a default now instead of Webpack.