wrangler-action icon indicating copy to clipboard operation
wrangler-action copied to clipboard

Bump default wrangler version to 3.91.0

Open Xbai-hang opened this issue 8 months ago • 3 comments

Add support for wrangler.jsonc by upgrading to wrangler v3.91.0+

Issue

When using the official GitHub Actions deployment script with a wrangler.jsonc file, the build fails unexpectedly. Error as follows:

You need to provide a name when publishing a worker. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`

Reproduction steps:

Project structure:

Auto generated by npm create hono@latest

├── package.json
├── src
│   └── index.ts
├── wrangler.jsonc  # Uses JSONC format
└── ...

Deploy

Run the GitHub Actions workflow from the Cloudflare documentation:


- uses: cloudflare/wrangler-action@v3
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

Result

Build fails due to unrecognized wrangler.jsonc support in older Wrangler versions.

Solution

Upgrade Wrangler to v3.91.0+ to resolve compatibility with wrangler.jsonc. This aligns with the community-reported issue #203 and ensures the action works as expected with modern configuration files.

Impact

  • Fixes deployment failures for projects using wrangler.jsonc.
  • Maintains backward compatibility with wrangler.json.

Xbai-hang avatar Apr 18 '25 11:04 Xbai-hang

#352

Xbai-hang avatar Apr 18 '25 11:04 Xbai-hang

Have you verified this version change? Also, is this backward compatible, would it not break and any new system?

The Wrangler version change is based on reference to Cloudflare documentation and has been validated.

GitHub Actions uses Wrangler v3.90.0 by default. According to the official documentation: https://developers.cloudflare.com/workers/wrangler/configuration/#sample-wrangler-configuration JSONC file support was introduced in Wrangler v3.91.0. image

Xbai-hang avatar Jun 13 '25 06:06 Xbai-hang

  1. your examples in official CloudFlare documentation use jsonc, but this action by default doesn't supoprt it (and there's no hint why it fails). That's very bad developer experience.
  2. why is the version fixed, and why to such an old version where wrangler is on 4.x now?
  3. is this action maintained? an important fix is unmerged for half a year. or should we use plain shell action?

itaysk avatar Sep 03 '25 14:09 itaysk