Skip to content

fix(blob): avoid @vercel/blob build breakage#860

Open
onmax wants to merge 1 commit intonuxt-hub:mainfrom
onmax:fix/blob-physical-shim-race
Open

fix(blob): avoid @vercel/blob build breakage#860
onmax wants to merge 1 commit intonuxt-hub:mainfrom
onmax:fix/blob-physical-shim-race

Conversation

@onmax
Copy link
Contributor

@onmax onmax commented Mar 5, 2026

Closes #859

Summary

  • remove the statically analyzable @vercel/blob/client import path from useMultipartUpload
  • load Vercel Blob client at runtime through a lazy importer helper
  • throw a clear actionable error when Vercel Blob client is missing:
    • @vercel/blob is required to use useMultipartUpload with Vercel Blob
    • pnpm add @vercel/blob
  • add focused tests for the helper behavior (module present, module missing, missing upload export)

Reproduction (Cloudflare-oriented)

Baseline repro app (@nuxthub/core@0.10.7, hub.blob: true, nitro.preset: 'cloudflare_module', useMultipartUpload referenced, no @vercel/blob):

pnpm nuxt build

Before this fix:

  • build fails with Rollup failed to resolve import "@vercel/blob/client" from useMultipartUpload.mjs

After this fix (installing this patched package into the same repro app):

  • pnpm nuxt build completes successfully

Tests

  • pnpm eslint src/blob/runtime/app/composables/useMultipartUpload.ts test/useMultipartUpload.vercel.test.ts
  • pnpm vitest test/useMultipartUpload.vercel.test.ts
  • pnpm vitest test/blob.test.ts
  • external repro check:
    • before patch: Cloudflare preset build fails with unresolved import
    • after patch: Cloudflare preset build succeeds without @vercel/blob

@vercel
Copy link

vercel bot commented Mar 5, 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/blob-physical-shim-race branch 2 times, most recently from a6dec4c to 92e2796 Compare March 5, 2026 16:19
@onmax onmax changed the title fix(core): resolve @nuxthub shim package root fix(blob): avoid @vercel/blob build breakage Mar 5, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 5, 2026

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

commit: 95d6448

@onmax onmax force-pushed the fix/blob-physical-shim-race branch from 92e2796 to 7f36864 Compare March 10, 2026 08:30
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.

useMultipartUpload Failed to resolve import "@vercel/blob/client" error on startup

1 participant