-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Use case:
I want to upload files larger than 4.5MB (vercel limit) from node.js enviroment (to be specific - from Electron main process which runs in node env)
I did follow steps at https://vercel.com/docs/storage/vercel-blob/client-upload and it works perfectly fine, but I'm only able to run it from browser env.
If I run it in node env I hit ${methodName} must be called from a client environment error. (
storage/packages/blob/src/client.ts
Line 52 in 5fb6969
| if (typeof window === 'undefined') { |
I did check the file https://github.com/vercel/storage/blob/5fb6969801107030adbdd156a1a1f2da8414eaad/packages/blob/src/client.ts and it seems to barely be using window, the only real case is
function toAbsoluteUrl(url: string): string {
return new URL(url, window.location.href).href;
}I think it might be quite common use case to handle such uploads externally. Is there any particular reason this use-case is restricted to Browser env?