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
cf dev --persist-to <dir> exits normally but ignores the flag, so the dev server keeps using its default state directory. With two Workers sharing one local D1/R2 through --persist-to, this shows up as no such table errors instead of a clear message.
Cause
The global middleware already rejects --persist-to without --local, and --local on cf dev. But it reads argv.persistTo, and cf dev disables camel-case-expansion, so only argv["persist-to"] exists there and the checks never run.
Forwarding the flag isn't an option: the delegates accept only --mode, --port, --host and --local (cloudflare/workers-sdk#14184), and node bin/cf-wrangler.js dev --persist-to x exits with Unknown option '--persist-to'.
Suggested fix
Read the kebab-case key in the middleware and fail with --persist-to is not supported by cf dev., matching the existing --local check (--help still allowed). A patch with tests and a changeset is here (pnpm check passes): 7kaji@3703629
I couldn't open a PR because this repository only accepts pull requests from collaborators.
Related (possible follow-ups)
Supporting --persist-to in cf dev would first need the delegate contract extended in workers-sdk.
cf dev -- --port 8787 drops everything after --.
cf's --local commands default to ~/.config/cloudflare/state, while wrangler dev defaults to .wrangler/state, so cf d1 migrations apply --local and cf dev see different local state.
Version: cf 1.0.0-beta.5 (the code is unchanged on main at bf0a0e7), wrangler 4.142.0 / 4.143.0, macOS.
Confirmed the -- forwarding issue on cf 1.0.0-beta.12 (Linux, Node.js 26.10.0). Using an argv-printing delegate:
Command
Delegate receives
cf dev --port 8787
["dev", "--port", "8787"]
cf dev -- --port 8787
["dev"]
cf dev -- --local
["dev"]
Arguments after -- are silently dropped.
Is forwarding after -- intended to be supported? Separately, since cf dev --local is explicitly rejected, what is the supported way to request Wrangler’s local-only startup through cf?
Happy to open a separate issue for the forwarding case if preferred.
Activity
0xkohe commentedon Oct 3, 2026
Confirmed the
--forwarding issue on cf 1.0.0-beta.12 (Linux, Node.js 26.10.0). Using an argv-printing delegate:cf dev --port 8787["dev", "--port", "8787"]cf dev -- --port 8787["dev"]cf dev -- --local["dev"]Arguments after
--are silently dropped.Is forwarding after
--intended to be supported? Separately, sincecf dev --localis explicitly rejected, what is the supported way to request Wrangler’s local-only startup through cf?Happy to open a separate issue for the forwarding case if preferred.
lnv-louis commentedon Oct 3, 2026
I second this.