diff --git a/empty.ts b/empty.ts new file mode 100644 index 0000000000..4e0a2c5f27 --- /dev/null +++ b/empty.ts @@ -0,0 +1,3 @@ +// Empty module to satisfy Turbopack resolveAlias fallback for Node.js modules +// See turbopack config in next.config.ts +export default {} diff --git a/next.config.ts b/next.config.ts index f5536ec88b..b3106dd10c 100644 --- a/next.config.ts +++ b/next.config.ts @@ -47,9 +47,21 @@ const config: NextConfig = { } }) }, + // Turbopack is the default bundler in Next.js 16 // Keep webpack config for now to support both bundlers - turbopack: {}, + + // Turbopack configuration for Next.js 16 (replaces webpack fallbacks) + turbopack: { + resolveAlias: { + fs: { + browser: './empty.ts', // Point to empty module when fs is requested for browser + }, + async_hooks: { + browser: './empty.ts', // Point to empty module when async_hooks is requested for browser + }, + }, + }, webpack: (webpackConfig) => { webpackConfig.experiments = webpackConfig.experiments || {}