Update Next.js configuration and improve Sentry integration
- Added `serverExternalPackages` to the Next.js configuration to exclude Node-only packages from the webpack bundle, enhancing compatibility with React's RSC/client boundary. - Refactored Sentry initialization and exception capturing to be asynchronous, ensuring proper handling of the Sentry DSN and preventing potential issues during Next.js builds. - Updated the `Toaster` component import in the layout to improve UI consistency.
This commit is contained in:
@@ -4,7 +4,10 @@ import type { NextConfig } from 'next';
|
||||
const nextConfig: NextConfig = {
|
||||
output: 'standalone',
|
||||
transpilePackages: ['@nexumi/shared'],
|
||||
outputFileTracingRoot: path.join(__dirname, '../..')
|
||||
outputFileTracingRoot: path.join(__dirname, '../..'),
|
||||
// Keep Node-only packages out of the Next server webpack bundle so they
|
||||
// cannot break React's RSC/client boundary during page-data collection.
|
||||
serverExternalPackages: ['@sentry/node', '@prisma/client', 'ioredis', 'bullmq']
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user