From d5c86ce9ab03cf9704daf2fac601553ee836c5d5 Mon Sep 17 00:00:00 2001 From: chojuninengu Date: Tue, 29 Apr 2025 10:56:55 +0100 Subject: [PATCH] Enhance Webpack configuration by adding fallbacks for Node.js core modules and integrating ProvidePlugin for Buffer and process support. --- next.config.mjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/next.config.mjs b/next.config.mjs index 0e1105d56..6f82475c8 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -21,9 +21,25 @@ const nextConfig = { } config.resolve.fallback = { + ...config.resolve.fallback, child_process: false, + process: false, + path: false, + fs: false, + os: false, + util: false, + stream: false, + buffer: require.resolve('buffer/'), + events: require.resolve('events/'), }; + config.plugins.push( + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + process: 'process/browser', + }), + ); + return config; }, output: mode,