mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #325] [ERROR] Could not resolve "virtual:vinext-rsc-entry" #75
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#75
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?
Originally created by @modlin-aurena on GitHub (Mar 7, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/325
I am currently trying to migrate my project from using OpenNext to vinext for Cloudflare Workers deployment.
The Worker successfully builds the app using
vinext deploybut fails at the end because of this error.This is my next.config.mjs
This is my vite.config.ts
This is my wrangler.jsonc
This is my package.json
Please help me and if you need more context please feel free to ask me.
@Divkix commented on GitHub (Mar 7, 2026):
Hey — thanks for the report. The error is because your
vite.config.tsis missing the@cloudflare/vite-plugin. Without it, Vite doesn't process the worker entry through its build pipeline, so wrangler's esbuild tries to bundle it directly and chokes on thevirtual:vinext-rsc-entryimport (which only the vinext Vite plugin can resolve).You already have
@cloudflare/vite-pluginin your devDependencies — you just need to use it. Update yourvite.config.tsto:The
cloudflare()plugin tells Vite to also build the worker entry through Vite's pipeline, where vinext resolves the virtual modules. Without it, wrangler falls back to its own bundler which has no idea whatvirtual:vinext-rsc-entryis.vinext deployalready warns about this (it detects when an existing vite config is missing the cloudflare plugin), but the warning is easy to miss since it doesn't halt the build. We'll be upgrading that to a hard error so this is caught earlier.Let us know if that fixes it.
@pablohenriqueop commented on GitHub (Mar 8, 2026):
Thanks, your suggestion works in my app.
@Divkix commented on GitHub (Mar 8, 2026):
Btw, we can add a feature which fails the build if
cloudflare()is not there.@james-elicx commented on GitHub (Mar 8, 2026):
I did add a warning in the deploy command but failing sounds reasonable as well 👍
@modlin-aurena commented on GitHub (Mar 8, 2026):
@pablohenriqueop Thank you for the solution, I did already figure it out but it does come with concerns regarding local development as I wasn't able to use
vinext devso I usenext devas of now instead.