Skip to content

Cloudflare dashboard deploy: split build + wrangler deploy conflicts with vinext — must skip build and use vinext deploy #2

Description

@hyf0

Experience feedback: deploying via the Cloudflare dashboard (Workers Builds)

When deploying a vinext app to Cloudflare Workers through Cloudflare's web dashboard Git integration ("Create Worker → connect repo" / Workers Builds), the UI splits the pipeline into two fields — a Build command and a Deploy command (where the deploy step is wrangler deploy). This split model fights vinext's all-in-one vinext deploy.

What goes wrong

Approach A — Build = vinext build (or a build:vinext script), Deploy = npx wrangler deploy:
wrangler deploy needs a wrangler.jsonc + worker entry, which don't exist in the repo until vinext generates them. So it either fails or forces you to hand-commit the config.

Approach B — let the dashboard auto-configure the framework:
It detects next and applies @opennextjs/cloudflare (OpenNext) instead of vinext, running @opennextjs/cloudflare migrate — which then fails on yarn 1.x because migrate internally calls yarn dlx (not a yarn-classic command):

🛠️  Configuring project for Next.js with OpenNext by running `@opennextjs/cloudflare migrate`
? Proceed with setup? 🤖 Using fallback value in non-interactive context: yes
yarn run v1.22.22
error Command "dlx" not found.
✘ [ERROR]
Failed: error occurred while running deploy command

What actually works

In the dashboard, leave the Build command empty (it's marked optional) and set the Deploy command to npx vinext deploy. vinext's one-command deploy then generates its own config, builds, and deploys — no OpenNext, no missing-config error.

Caveats hit along the way

  • vinext deploy runs vinext build internally, which does not run any custom prebuild step. If your real build does extra work (e.g. node scripts/downloadFonts.mjs for self-hosted fonts), it's silently skipped — you must replicate it in the optional Build command.
  • vinext deploy --skip-build exists to bridge "build separately, then deploy", but it's confusing in the dashboard context: it only makes sense because vinext deploy is an all-in-one command shoehorned into a deploy-only slot.

Suggestions

  • Document the Cloudflare dashboard deploy path explicitly (current guidance assumes the CLI). Recommend: empty Build command + vinext deploy as the Deploy command.
  • Detect/avoid Cloudflare's OpenNext auto-setup, or at least note the conflict.
  • Consider a documented build/deploy split story (when to commit the generated wrangler.jsonc + use wrangler deploy, vs. one-shot vinext deploy).

Environment: vinext 0.1.8 · yarn 1.22.22 · Cloudflare Workers Builds (dashboard Git integration).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: lowLow priority / deferarea: deployCloudflare Workers deploydocumentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions