You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cf dev rejects --port and --host for Vite projects, including the cf init template #223
In a project created by cf init (which uses the Vite plugin v2 beta), cf dev refuses --port and --host:
$ cf dev --port 8787
┌ Error
│ Arguments cannot currently be forwarded to the detected dev command `npx
│ vite`. Run that command directly with the required arguments.
└
--host 127.0.0.1 fails the same way. --mode production is forwarded (Delegating to npx vite "--mode" "production"), and #22 shows --port reaching the Wrangler delegate. So the default template is the one setup where you can't change the dev server's port or host through cf dev.
Running npx vite --port 8787 works, but it skips cf's detection and autoconfig and means a different command than the one cf init prints in its next steps.
Expected behaviour
cf dev --port <n> and cf dev --host <h> forward to Vite as --port/--host, as they already do for the Wrangler delegate and as --mode already does for Vite.
cf init demo --package-manager npm
cd demo
cf dev --port 8787 # error above
cf dev --host 127.0.0.1 # same error
cf dev --mode production # forwarded and works
Relevant error logs (optional)
Related: #22 (--persist-to ignored, and arguments after -- dropped).
Activity