From d6a621906e6b1b54df25ab9113b611807ac32aaa Mon Sep 17 00:00:00 2001 From: Deepak Pandey Date: Fri, 12 Sep 2025 19:58:42 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20CRITICAL=20FIX:=20Remove=20webpa?= =?UTF-8?q?ck=20externals=20causing=20require()=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🚨 Critical Issue Fixed - ✅ Remove problematic webpack externals configuration - ✅ Fix 'require is not defined' errors in browser - ✅ Prevent Node.js modules from being bundled for client-side - ✅ Restore website functionality ## 🎯 Root Cause - webpack externals were causing Supabase modules to be excluded incorrectly - This led to 'require is not defined' errors in the browser - Website was completely broken with 'Something went wrong' error ## 📊 Results - ✅ Website should now load properly - ✅ No more 'require is not defined' errors - ✅ Supabase client should work correctly in browser - ✅ Edge Runtime compatibility maintained --- next.config.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/next.config.ts b/next.config.ts index 3779969f..9e215fa5 100644 --- a/next.config.ts +++ b/next.config.ts @@ -24,18 +24,12 @@ const nextConfig: NextConfig = { config.resolve.fallback = { ...config.resolve.fallback, fs: false, + net: false, + tls: false, + crypto: false, } } - // Handle Edge Runtime compatibility for Supabase - config.externals = config.externals || [] - if (!isServer) { - config.externals.push({ - '@supabase/supabase-js': 'commonjs @supabase/supabase-js', - '@supabase/ssr': 'commonjs @supabase/ssr', - }) - } - return config },