Skip to content

Fix unclear error when assets upload session returns a null response#12841

Merged
dario-piotrowicz merged 1 commit intomainfrom
dario/9465/assets-null-response
Mar 13, 2026
Merged

Fix unclear error when assets upload session returns a null response#12841
dario-piotrowicz merged 1 commit intomainfrom
dario/9465/assets-null-response

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

@dario-piotrowicz dario-piotrowicz commented Mar 10, 2026

Fixes #9465

When deploying assets, if the Cloudflare API returns a null response object, Wrangler now provides a clear error message asking users to retry instead of failing with a confusing error.


  • 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 simply improves an error message

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


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 10, 2026

🦋 Changeset detected

Latest commit: ac662b3

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 2026

✅ All changesets look good

ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 10, 2026

I'm Bonk, and I've done a quick review of your PR.

The PR adds a null-check on the assets upload session API response and throws a clear FatalError instead of crashing with a confusing error. The logic and test are solid.

I flagged one low-severity issue: the comment on lines 81-82 of packages/wrangler/src/assets.ts is grammatically broken and says the opposite of what's intended. I posted a suggestion comment on the PR with a fix.

github run

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 10, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 65e2ab4

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 11, 2026
@dario-piotrowicz dario-piotrowicz force-pushed the dario/9465/assets-null-response branch from f6895a8 to ac662b3 Compare March 11, 2026 11:44
@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review March 12, 2026 12:18
@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner March 12, 2026 12:18
@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

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 1 additional finding.

Open in Devin Review

@dario-piotrowicz dario-piotrowicz merged commit 7b0d8f5 into main Mar 13, 2026
53 of 58 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/9465/assets-null-response branch March 13, 2026 10:41
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Cannot read properties of null (reading 'buckets')

3 participants