Skip to content

[vite-plugin-cloudflare] Surface export type fetch errors - #15407

Open
xgame92 wants to merge 1 commit into
cloudflare:mainfrom
xgame92:xgame92/fix-vite-export-types-errors
Open

[vite-plugin-cloudflare] Surface export type fetch errors#15407
xgame92 wants to merge 1 commit into
cloudflare:mainfrom
xgame92:xgame92/fix-vite-export-types-errors

Conversation

@xgame92

@xgame92 xgame92 commented Aug 28, 2026

Copy link
Copy Markdown

Fixes #15370.

When Miniflare returned a non-success response while the Vite plugin fetched Worker export types, the plugin attempted to parse the plain-text error body as JSON. This replaced the underlying failure with an unrelated SyntaxError.

This change checks the response status before JSON parsing and reports the Worker name, HTTP status, and original response body. Successful JSON responses keep their existing behavior.


  • 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 only improves an internal development error message and adds regression coverage.

Local verification:

  • pnpm test (199 tests)
  • pnpm check:type
  • type-aware Oxlint on changed TypeScript files
  • Oxfmt check on all changed files
  • pnpm build

Devin Review

@changeset-bot

changeset-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9b67e0c

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

This PR includes changesets to release 1 package
Name Type
@cloudflare/vite-plugin Patch

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Aug 28, 2026
@workers-devprod
workers-devprod requested review from a team and edmundhung and removed request for a team August 28, 2026 15:12
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/calm-rivers-report.md: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/src/tests/cloudflare-environment.spec.ts: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/src/cloudflare-environment.ts: [@cloudflare/wrangler]

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

Copy link
Copy Markdown
Contributor

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 bugs or issues to report.

Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 28, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15407

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15407

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15407

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15407

create-cloudflare

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

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15407

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15407

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15407

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15407

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15407

wrangler

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

commit: 9b67e0c

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.

@cloudflare/vite-plugin dev: get_export_types handshake fails with plain-text error body → JSON.parse SyntaxError crash-loops the dev server

2 participants