Skip to content

fix(blob): validate multipart upload body#763

Merged
atinux merged 1 commit intonuxt-hub:mainfrom
onmax:fix/multipart-body-validation
Jan 13, 2026
Merged

fix(blob): validate multipart upload body#763
atinux merged 1 commit intonuxt-hub:mainfrom
onmax:fix/multipart-body-validation

Conversation

@onmax
Copy link
Copy Markdown
Contributor

@onmax onmax commented Jan 1, 2026

Fixes #762

Problem

handleMultipartUpload throws cryptic 500 error "cannot read properties of undefined (reading 'type')" when request body is empty/invalid.

Changes

  1. Fix: Added body validation in vercel-blob.ts before passing to Vercel's handleUpload
  2. Docs: Clarified that Vercel Blob uses [...pathname] route pattern (no [action])

Reproduction

git clone --depth 1 --filter=blob:none --sparse https://github.com/onmax/repros.git
cd repros && git sparse-checkout set nuxthub-762
cd nuxthub-762 && pnpm i && pnpm dev

Trigger error (in another terminal):

curl -X POST http://localhost:3005/api/blob/multipart/test.pdf -H "Content-Type: application/json"

Before: 500 Cannot read properties of undefined (reading 'type')

Verify fix

cd .. && git sparse-checkout add nuxthub-762-fixed
cd nuxthub-762-fixed && pnpm i && pnpm dev

Same curl command now returns:

After: 400 Invalid multipart upload request body

The -fixed folder includes a pnpm patch with the fix.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 1, 2026

@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@onmax onmax force-pushed the fix/multipart-body-validation branch 2 times, most recently from ad34786 to d7a3d0a Compare January 1, 2026 12:45
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jan 1, 2026

npm i https://pkg.pr.new/@nuxthub/core@763

commit: 0b01303

@onmax onmax force-pushed the fix/multipart-body-validation branch from 91ed498 to 0b01303 Compare January 1, 2026 14:28
@atinux atinux merged commit ea5ecb8 into nuxt-hub:main Jan 13, 2026
7 of 9 checks passed
@onmax onmax deleted the fix/multipart-body-validation branch January 13, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Suspected Bug] Handle Multipart Upload emitting errors: cannot read properties of undefined (reading 'type')

2 participants