mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #3] [MERGED] fix: exclude vinext from optimizeDeps to prevent virtual module resolution errors #236
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/3
Author: @threepointone
Created: 2/24/2026
Status: ✅ Merged
Merged: 2/24/2026
Merged by: @southpolesteve
Base:
main← Head:fix/exclude-vinext-from-optimizedeps📝 Commits (2)
0c15c4afix: exclude vinext from optimizeDeps to prevent virtual module resolution errors2f3c2bftest: verify optimizeDeps.exclude contains vinext for all environments📊 Changes
2 files changed (+96 additions, -0 deletions)
View changed files
📝
packages/vinext/src/index.ts(+9 -0)📝
tests/build-optimization.test.ts(+87 -0)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.