2025-05-27 16:35:31 +08:00
|
|
|
import { withSentryConfig } from '@sentry/nextjs';
|
2025-05-05 17:27:36 +08:00
|
|
|
import type { NextConfig } from 'next';
|
2025-04-16 01:20:15 +08:00
|
|
|
|
2025-05-27 16:35:31 +08:00
|
|
|
let nextConfig: NextConfig = {
|
2025-04-23 12:57:41 +08:00
|
|
|
webpack: (config) => {
|
|
|
|
// This rule prevents issues with pdf.js and canvas
|
2025-05-05 17:27:36 +08:00
|
|
|
config.externals = [...(config.externals || []), { canvas: 'canvas' }];
|
|
|
|
|
2025-04-23 12:57:41 +08:00
|
|
|
// Ensure node native modules are ignored
|
|
|
|
config.resolve.fallback = {
|
|
|
|
...config.resolve.fallback,
|
|
|
|
canvas: false,
|
|
|
|
};
|
2025-05-05 17:27:36 +08:00
|
|
|
|
2025-04-23 12:57:41 +08:00
|
|
|
return config;
|
|
|
|
},
|
2025-04-16 01:20:15 +08:00
|
|
|
};
|
|
|
|
|
2025-05-27 16:35:31 +08:00
|
|
|
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'production') {
|
|
|
|
nextConfig = withSentryConfig(nextConfig, {
|
|
|
|
org: 'kortix-ai',
|
|
|
|
project: 'suna-nextjs',
|
|
|
|
silent: !process.env.CI,
|
|
|
|
widenClientFileUpload: true,
|
|
|
|
tunnelRoute: '/monitoring',
|
|
|
|
disableLogger: true,
|
|
|
|
automaticVercelMonitors: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2025-04-16 01:20:15 +08:00
|
|
|
export default nextConfig;
|