vercel / storage

Vercel Postgres, KV, Blob, and Edge Config
https://vercel.com/storage
Apache License 2.0
517 stars 58 forks source link

storage.put() is hanging in Deno #656

Closed begoon closed 6 months ago

begoon commented 7 months ago

storage.put() is hanging in Deno.

vercel-storage.js:

import { put } from "@vercel/blob";
import "dotenv/config";
const { url } = await put("name", "value", { access: "public" });
console.log("url", url);

When running in Deno:

DEBUG=blob deno run -A ./vercel-storage.js

Warning Sloppy imports are not recommended and have a negative impact on performance.
vercel-blob: retrying API request to /name fetch failed
vercel-blob: retrying API request to /name fetch failed
vercel-blob: retrying API request to /name fetch failed
vercel-blob: retrying API request to /name fetch failed
vercel-blob: retrying API request to /name fetch failed
deno 1.42.2 (release, aarch64-apple-darwin)
v8 12.3.219.9
typescript 5.4.3

When running in Node and Bun, this snippet works as expected:

DEBUG=blob bun ./vercel-storage.js        
url https://sguoidzdzzo8p3ur.public.blob.vercel-storage.com/name-Q3WSl0hpPskaqp02XHxOhavC7JyYdQ

DEBUG=blob node ./vercel-storage.js
url https://sguoidzdzzo8p3ur.public.blob.vercel-storage.com/name-2tzXwVwLn5vdm1uaz1nB5pG0YEMz21
lukahartwig commented 7 months ago

Hey, thanks for reporting. This library uses Undici fetch which seems to be completely broken in Deno due to an incomplete node:http polyfill. I reported this issue to Deno here.

luismeyer commented 6 months ago

closing, because the issue is fixed in deno and I couldn't repro this issue anymore