Skip to content

Conversation

@onmax
Copy link
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

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

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
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')

1 participant