Skip to content

fix(cf-docs): qualify the Wrangler installation requirement for migration previews #35436

Open

Description

@coygeek

Existing documentation URL(s)

What changes are you suggesting?

Clarify that migration previews can succeed before local Wrangler installation for a supported declaration. Keep the requirements for building and running the migrated Worker separate.

Additional information

Summary

The migration guide says the Wrangler bundler needs a local Wrangler installation even for cf migrate --dry-run. A fresh Worker package with a compatible Wrangler version declared in package.json can preview the migration before installing that dependency.

Steps to reproduce

Install the stated cf release outside the fixture, then use it on a Worker with a Wrangler declaration but no installed project dependencies. Run these commands in a disposable directory outside any existing worktree.

cf_cli_dir=$(mktemp -d)
npm install --prefix "$cf_cli_dir" cf@1.0.0-rc.1
printf '%s\n' '{"name":"migration-fixture","private":true,"type":"module","devDependencies":{"cf":"1.0.0-rc.1","wrangler":"4.164.0"}}' > package.json
printf '%s\n' '{"name":"migration-fixture","main":"index.js","compatibility_date":"2025-01-01","minify":true}' > wrangler.jsonc
printf '%s\n' 'export default { fetch() { return new Response("fixture"); } };' > index.js
test ! -e node_modules/wrangler
"$cf_cli_dir/node_modules/.bin/cf" migrate --bundler wrangler --dry-run
printf 'Exit status: %s\n' "$?"
test ! -e node_modules && test ! -e cloudflare.config.ts && test ! -e wrangler.config.ts

Expected behavior

Describe the preview prerequisite separately from commands that actually run the bundler. For the tested package with a compatible declaration and no installed Wrangler, the documentation should reflect that the dry run can print its plan before dependencies are installed.

Actual behavior

The Troubleshooting section says an absent local installation produces an error even for a dry run. The fixture had no installed Wrangler. Its command exited 0, listed cloudflare.config.ts and wrangler.config.ts under planned writes, and reported Migration preview complete. It left both configuration files unwritten and Wrangler uninstalled.

Evidence

  • Expected source: The published CLI in the no-install fixture above. The current Wrangler version check also treats a compatible declaration and an absent installed version as requiring no upgrade specifier.
  • Failure source: The Wrangler is missing or too old section of the migration guide, src/content/docs/cf/wrangler/migrate.mdx.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Restoration check

Apply the published preview instructions to the fixture. The guide should make clear that the preview can succeed for this compatible declaration before installation, while keeping the actual development and build prerequisites separate. The dry run should still leave the project unchanged.

Runtime or environment

macOS arm64, Node.js 26.13.1, npm 12.2.2, and the published cf 1.0.0-rc.1. Wrangler 4.164.0 was declared in the fixture and not installed. The documentation source was checked on production at c0b23090e9948bc5188a60c796cddc0cf4eb5bb3.

References

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: The guide tells readers of a supported preview workflow to install project dependencies before inspecting the plan, including when they intend to review the planned migration first in CI.
  • Workaround status: available
  • Workaround basis: A dry run on the tested fixture with a compatible declaration and fresh dependency state reported the plan and made no project writes.
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