[C3] React framework path does not generate Vite-plugin template; --variant undocumented and --accept-defaults does not suppress variant prompt
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, react, typescript, vite
- Domain
- cli, devtools, documentation
Research direction
Start by reading the C3 CLI arguments documentation and the React framework guide, then trace how --variant and --accept-defaults are handled for React starters. Compare the documented commands with the reported C3 v2.75.1 behavior and the react-starter-template path. Done means the variant flag and its accepted values, defaults prompt behavior, and React scaffold instructions accurately describe the supported paths.
Written by the indexing model from the issue text.
Description
Which Cloudflare product(s) does this pertain to?
C3 (create-cloudflare) and the React framework guide.
What version(s) of the tool(s) are you using?
create-cloudflare v2.75.1. Wrangler 4.136.1 was installed by the working template.
What version of Node are you using?
v22.22.3
What operating system and version are you using?
Windows 11, Windows PowerShell 5.1, npm 12.2.3.
Describe the bug
Three related CLI/documentation mismatches surfaced while scaffolding a React + TypeScript + Vite app for Workers:
--variantis a real, validated C3 flag, but it is absent from the C3 CLI arguments documentation.--lang=tsdoes not select the variant for framework starters. This appears to be the flag implemented for #9600, but the public docs still do not describe it.--accept-defaultsdoes not suppress the interactive “Select a variant” prompt.- The React framework guide says
npm create cloudflare@latest -- my-react-app --framework=reactscaffolds a React SPA, Workers API, and the Cloudflare Vite plugin. In C3 v2.75.1,--framework=reactdelegates to plaincreate-vite --template react-tsand a separate Cloudflare configuration step. The result has no@cloudflare/vite-plugin, norun_worker_first, an auto-selected compatibility date, and the directory name as the Worker name. The plugin-enabled template only came from--template=cloudflare/templates/react-starter-template.
Steps to reproduce
Attempt 3 — --lang=ts does not select the variant:
npx --yes create-cloudflare@latest production-starter --framework=react --lang=ts --no-deploy --no-open --no-git
Attempt 4 — invalid --variant value is validated:
npx --yes create-cloudflare@latest production-starter --framework=react --platform=workers --variant=ts --deploy=false --open=false --git=false --no-agents
Attempt 6 — --accept-defaults still stops at the variant prompt:
npx --yes create-cloudflare@latest production-app --framework=react --accept-defaults --no-deploy --no-open --no-git --no-agents
Attempt 7 — --variant=react-ts works but delegates to create-vite:
npx --yes create-cloudflare@latest production-app --framework=react --variant=react-ts --no-deploy --no-open --no-git --no-agents
Working plugin-enabled path:
npx --yes create-cloudflare@latest production-official --template=cloudflare/templates/react-starter-template --no-deploy --no-open --no-git
Expected behavior
--variantshould be documented with its accepted React values (react-ts,react), especially since--lang=tsdoes not drive framework-variant selection.--accept-defaultsshould suppress the variant prompt, or its limits should be documented.- The React guide should either reflect that
--framework=reactproduces the plain Vite + Wrangler configuration in v2.75.1, or state that the plugin-based template must be requested with--template=cloudflare/templates/react-starter-template.
Actual behavior / verbatim evidence
Attempt 3 output:
╭ Create an application with Cloudflare Step 1 of 3
│
├ In which directory do you want to create your application?
│ dir ./production-starter
│
├ What would you like to start with?
│ category Framework Starter
│
├ Which development framework do you want to use?
│ framework React
│
├ Select your deployment platform
│ platform Workers with Assets
│
╰ Select a variant:
● TypeScript
○ JavaScript
Attempt 4 output:
╰ ERROR Error: Unknown variant "ts". Valid variants are: react-ts, react
C3 failed with exit code 1
Attempt 6 output:
╰ Select a variant:
● TypeScript
○ JavaScript
Attempt 7 output, showing delegation to plain Vite:
├ Continue with React via `npx [email protected] production-app --template react-ts --no-immediate`
The scaffold from attempt 7 had no @cloudflare/vite-plugin in package.json, vite.config.ts contained only @vitejs/plugin-react, and the partially generated wrangler.jsonc still had <WORKER_NAME> and <COMPATIBILITY_DATE> placeholders after a timeout. A separate completed run with --platform=workers --variant=react-ts produced the same no-plugin result cleanly, with name: "production-starter", compatibility_date: "2026-11-23", assets.not_found_handling: "single-page-application", and no run_worker_first.
The official template run produced the expected plugin wiring:
production-official\package.json:21: "@cloudflare/vite-plugin": "1.52.1",
production-official\vite.config.ts:3:import { cloudflare } from "@cloudflare/vite-plugin";
production-official\vite.config.ts:6: plugins: [react(), cloudflare()],
Additional context
Two other confirmed gotchas, though secondary to the three findings above:
npm create cloudflare@latest -- . --framework=react ...fails on npm 12 withEUNKNOWNCONFIG/ “Unknown cli flags: --framework --deploy --open”.npx create-cloudflare@latest ...is the reliable form here.- C3 rejects
.as a project name: “Project names must only contain lowercase characters, numbers, and dashes.” --no-agentsis a real flag; without it C3 prompts whether to addAGENTS.md.
The working project builds cleanly with npm run build; the Vite plugin emits dist/<worker>/wrangler.json and dist/client, which confirms why the deploy workflow must build before calling Wrangler.
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 1.7k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 282
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/workers-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cloudflare/workers-sdk#17215 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
cloudflare/workers-sdk#17189 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/workers-sdk#17187 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
cloudflare/workers-sdk#17175 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/workers-sdk#17174 ·
Maintainers usually reply within 1 day
All issues in cloudflare/workers-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
earendil-works/pi#12615 ·
Maintainers usually reply within 1 day
-
My Caps shows "Shared" on private Caps that were never sharedPossibly taken @AksharP5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CapSoftware/Cap#4569 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/Data2Evidence#3749 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Flagsmith/flagsmith-nodejs-client#332 ·
Maintainers usually reply within 2 days