Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Sep 12, 2025

🚨 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

Summary by CodeRabbit

  • Bug Fixes
    • Resolved occasional client-side errors related to Node-specific modules in the browser, improving reliability across pages that use these features.
  • Chores
    • Updated client build configuration to better handle browser environments and avoid unnecessary polyfills.
    • Simplified dependency handling by bundling certain libraries directly instead of externalizing them, reducing configuration complexity and potential integration issues.
    • Overall, improves stability and predictability of the web app in client contexts without changing user-facing functionality.

## 🚨 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
@vercel
Copy link

vercel bot commented Sep 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codeunia Building Building Preview Comment Sep 12, 2025 2:29pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Client-side webpack config now sets resolve.fallback for net, tls, and crypto to false (alongside fs). Removal of client-side externals for '@supabase/supabase-js' and '@supabase/ssr' means these packages are no longer externalized and will be bundled normally.

Changes

Cohort / File(s) Summary
Build config adjustments
next.config.ts
Added config.resolve.fallback entries: net: false, tls: false, crypto: false (keeping fs: false). Removed code that pushed @supabase/supabase-js and @supabase/ssr into config.externals for client builds, so these libraries are now bundled rather than externalized.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws at build-time cheer,
No externals nowβ€”bring Supabase near!
Net, tls, crypto set to no,
The bundle hops where modules go.
In leafy logs, I twirl my earβ€”
Config is tidy, the path is clear. πŸ‡βœ¨


πŸ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 53aadfe and d6a6219.

πŸ“’ Files selected for processing (1)
  • next.config.ts (1 hunks)
✨ Finishing touches
  • πŸ“ Generate Docstrings
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ci-cd-pipeline-and-performance-optimizations

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeunia-dev codeunia-dev merged commit 2fc5087 into main Sep 12, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants