This repository was archived by the owner on Oct 9, 2025. It is now read-only.
fix: remove dynamic imports to eliminate webpack warnings #514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix / Compatibility improvement - Eliminates bundler warnings and runtime failures caused by dynamic imports while simplifying WebSocket detection logic.
What is the current behavior?
Dynamic imports cause widespread compatibility issues:
Critical dependency: the request of a dependency is an expressionin Webpack buildsRelated Issues:
npx create-next-app -e with-supabase)Current problematic code:
What is the new behavior?
Clean, explicit WebSocket configuration that works universally:
For most users (Browser, Node.js 22+): No changes required
For Node.js < 22 users: Simple one-time migration to explicit configuration
Enhanced error messages guide users through migration:
Additional context
Why This Journey Led Here
The Problem Evolution:
isowsdependency caused "missing isows" issuesisowsbut reintroduced bundler warnings with dynamic importsrealtime-jsandsupabase-jsWhy This Is NOT a Breaking Change
Current behavior is already broken for many users:
Production Failures (from Issue #1437):
require()callsThis PR fixes broken functionality rather than breaking working functionality.
Ecosystem Readiness
eval()or dynamicrequire()workaroundsUser Impact Analysis
Long-term Benefits
Alternative Approaches Considered
eval(require)workaround: Rejected due to CSP violations and security concerns