Skip to content

[vite-plugin] Fix dev crashes when Worker entries use standard decorators#12887

Open
dmmulroy wants to merge 1 commit intocloudflare:mainfrom
dmmulroy:fix/vite-plugin-decorator-dev
Open

[vite-plugin] Fix dev crashes when Worker entries use standard decorators#12887
dmmulroy wants to merge 1 commit intocloudflare:mainfrom
dmmulroy:fix/vite-plugin-decorator-dev

Conversation

@dmmulroy
Copy link
Copy Markdown
Contributor

@dmmulroy dmmulroy commented Mar 13, 2026

Fixes #12626.

Lower standard decorators before Vite's dev module runner evaluates Worker entry modules.

This forces esbuild.supported.decorators = false so decorators are lowered consistently in development, and adds unit and e2e regression coverage for the reported crash.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this is a bug fix for internal dev-time transformation behavior.

A picture of a cute animal (not mandatory, but encouraged)

🦦


Open with Devin

@dmmulroy dmmulroy requested a review from a team as a code owner March 13, 2026 16:07
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 13, 2026

🦋 Changeset detected

Latest commit: 6aa0294

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/vite-plugin-cloudflare/e2e/decorators.test.ts: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/e2e/fixtures/decorators/package.json: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/e2e/fixtures/decorators/src/index.ts: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/e2e/fixtures/decorators/tsconfig.json: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/e2e/fixtures/decorators/vite.config.ts: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/e2e/fixtures/decorators/wrangler.jsonc: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/src/tests/config.spec.ts: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/src/plugins/config.ts: [@cloudflare/wrangler]

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@dmmulroy
Copy link
Copy Markdown
Contributor Author

Note for transparency: this investigation and the draft fix were generated with GPT-5.4 on xhigh in OpenCode, while being actively monitored, reviewed, and guided by Dillon Mulroy (@dmmulroy).

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 13, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12887

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12887

miniflare

npm i https://pkg.pr.new/miniflare@12887

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12887

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12887

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12887

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12887

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12887

wrangler

npm i https://pkg.pr.new/wrangler@12887

commit: 8724a8b

@dmmulroy dmmulroy force-pushed the fix/vite-plugin-decorator-dev branch from 09d5218 to 6aa0294 Compare March 13, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

Cannot use @callable with @cloudflare/vite-plugin

2 participants