Skip to content

Deployment fails during application creation when using template because assets have not been built #699

@ewantindale

Description

@ewantindale

What versions & operating system are you using?

Node v22.12.0, Ubuntu 24.04.2, Wrangler 4.19.2

Please provide a link to a minimal reproduction

No response

Describe the Bug

When running npm create cloudflare using one of the templates which require a build step, in this case vite-react-template, it asks you if you want to deploy your application and if you select yes it runs npm run deploy but this fails because we have not run npm run build so the assets aren't actually there.

I would expect it to automatically run the build script before the deploy script.

Please provide any relevant error logs

ewan@ewan:/media/ewan/ssd/projects$ npm create cloudflare@latest -- --template=cloudflare/templates/vite-react-template

> npx
> create-cloudflare --template=cloudflare/templates/vite-react-template


────────────────────────────────────────────────────────────────────────────────
👋 Welcome to create-cloudflare v2.49.1!
🧡 Let's get started.
📊 Cloudflare collects telemetry about your usage of Create-Cloudflare.

Learn more at: https://github.com/cloudflare/workers-sdk/blob/main/packages/create-cloudflare/telemetry.md
────────────────────────────────────────────────────────────────────────────────

╭ Create an application with Cloudflare Step 1 of 3
│
├ In which directory do you want to create your application?
│ dir ./jolly-math-2210
│
├ What would you like to start with?
│ category Template from a GitHub repo
│
├ What's the url of git repo containing the template you'd like to use?
│ repository cloudflare/templates/vite-react-template
│
├ Cloning template from: cloudflare/templates/vite-react-template
│
├ template cloned and validated
│
├ Copying template files
│ files copied to project directory
│
├ Installing dependencies
│ installed via `npm install`
│
╰ Application created 

╭ Configuring your application for Cloudflare Step 2 of 3
│
├ Installing wrangler A command line tool for building Cloudflare Workers
│ installed via `npm install wrangler --save-dev`
│
├ Adding Wrangler files to the .gitignore file
│ updated .gitignore file
│
├ Generating types for your application
│ generated to `./worker-configuration.d.ts` via `npm run cf-typegen`
│
├ Installing @types/node
│ installed via npm
│
├ Do you want to use git for version control?
│ yes git
│
├ Initializing git repo
│ initialized git
│
├ Committing new files
│ git commit
│
╰ Application configured 

╭ Deploy with Cloudflare Step 3 of 3
│
├ Do you want to deploy your application?
│ yes deploy via `npm run deploy`
│
├ Logging into Cloudflare checking authentication status
│ logged in
│
├ Selecting Cloudflare account retrieving accounts
│ account [email protected]'s Account
│

> [email protected] deploy
> wrangler deploy


 ⛅️ wrangler 4.19.2
───────────────────

✘ [ERROR] The directory specified by the "assets.directory" field in your configuration file does not exist:

  /media/ewan/ssd/projects/jolly-math-2210/dist/client


🪵  Logs were written to "/home/ewan/.config/.wrangler/logs/wrangler-2025-06-12_10-09-11_374.log"
╰  ERROR  Error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions