Skip to content

fix(cf): document that prebuilt deploy can omit --mode #35430

Open

Description

@coygeek

Existing documentation URL(s)

What changes are you suggesting?

Explain that cf deploy --prebuilt can use Vite Build Output that records production without an explicit mode. Show an omitted-mode example and keep an explicit matching mode as an optional check. Replace the troubleshooting example for an omitted mode with guidance for an explicitly mismatched mode. Update the configuration page's reference to the same rule.

Additional information

Summary

The prebuilt deployment guide and its troubleshooting example describe --mode production as mandatory when a Vite build records production. The released CLI accepts that output without the flag and still rejects a conflicting explicit mode.

Steps to reproduce

With the CLI version below on PATH, run these commands in a scratch directory. After the build, all three dry runs use the same output.

cf init mode-docs-demo --package-manager npm
cd mode-docs-demo
cf build
jq '.buildContext.mode' .cloudflare/output/v1/config.json
cf deploy --dry-run --prebuilt
cf deploy --dry-run --prebuilt --mode production
cf deploy --dry-run --prebuilt --mode staging

Expected behavior

The documentation describes how validation works for this Vite build. Omitting the flag is valid, an explicit production matches, and an explicit staging conflicts with the recorded mode.

Actual behavior

The guide requires the explicit flag and shows an error for omitting it. The local build recorded production. The dry runs with the flag omitted and with --mode production both reached --dry-run: exiting now. and exited 0. The run with --mode staging reported that the output was created with production but the command requested staging, and exited 1. Verification used dry runs only.

Evidence

  • Expected source: The CLI change that made the flag optional. In the release source, uploadBuildOutput calls validateBuildOutputMode before resolving authentication for both regular deployments and dry runs. The validator returns when no mode is requested.
  • Failure source: The deployment and troubleshooting sections linked above, also present in src/content/docs/cf/projects/index.mdx on production, compared with the three CLI outcomes above.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Restoration check

Read the updated published guide and its linked configuration section against the three dry runs above. The documentation should allow the omitted and matching cases and explain the rejection of the mismatched case.

Runtime or environment

Linux x64, Node.js 26.13.1, cf 1.0.0-rc.1, and Build Output produced by @cloudflare/vite-plugin 2.0.0-rc.1. The docs were checked on production at 4efcbd4b00eaa602e9262144fea31cd852c49f59.

References

Triage assessment

  • Impact level: P3
  • Assessment status: supported
  • Impact basis: The guide describes a validation error for an accepted command. Its example with the explicit matching flag still works.
  • Workaround status: available
  • Workaround basis: Both omitting the flag and passing the matching --mode production succeeded in the dry run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions