fix: exclude vinext from optimizeDeps to prevent virtual module resolution errors#3
Merged
southpolesteve merged 2 commits intomainfrom Feb 24, 2026
Merged
Conversation
…ution errors When vinext is installed from npm (not symlinked), esbuild's dependency optimization scans vinext/dist/ and hits virtual:vinext-* imports that only exist at Vite plugin resolution time. This causes build failures in all three environments (client, rsc, ssr). Adding optimizeDeps.exclude: ['vinext'] at the top level and in each environment prevents esbuild from scanning vinext's dist files entirely. Fixes #1
|
Collaborator
|
/bigbonk give this a review |
southpolesteve
added a commit
that referenced
this pull request
Feb 27, 2026
…mmands, COST.md - Benchmarks: Rollup 2.4x faster, Rolldown 6.2x faster, 55-56% smaller bundles - "use cache" now marked Full (was "Not yet") — directive, cacheLife, cacheTag all work - Added vinext deploy and vinext check to CLI reference - Updated vinext deploy section from "coming soon" to actual capabilities - Added connection() and static export as Full features - Test counts: 844 vitest + 278 Playwright E2E - COST.md: 207 commits, ~45K source lines, ~25K test lines - Downgraded PPR (#3) from P1 to P2 (still experimental in Next.js)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When vinext is installed from npm (not symlinked),
vite devfails with:esbuild's dependency optimization scans
vinext/dist/and hitsvirtual:vinext-*imports that only exist at Vite plugin resolution time. This occurs in all three environments (client, rsc, ssr).Fix
Adds
optimizeDeps.exclude: ["vinext"]at the top level and in each environment config (rsc, ssr, client). This prevents esbuild from scanning vinext's dist files during pre-bundling.Uses the stable
optimizeDeps.excludeAPI rather than an esbuild plugin, so it won't break in future Vite majors.Fixes #1