Next.js Discord

Discord Forum

Firebase and Firebase Admin Storage error

Unanswered
Selkirk Rex posted this in #help-forum
Open in Discord
Selkirk RexOP
I want to upload files to my storage bucket, in my API endpoint when I try to use firebase uploadBytes first I got a XMLHttpRequest is not defined error. I found out that xhr wasn't native to server environments. I installed xmlhttprequest and set it as a global variable, this solved the not defined issue but now I get this:

XMLHttpError: the "string" argument must be of type string, buffer or ArrayBuffer, received an instance of Blob

I tried to upload with uploadBytes, uploadBytesResumable and uploadString. Still facing the same.


So, I went ahead and installed firebase admin, now I get os module is not supported in edge runtime. I need edge runtime as I have other functions that rely on it, and now I can't use admin SDK as well.


I've been stuck in this for the past week or so, any help is appreciated. I don't really care about using admin SDK, I just want to be able to upload files.

Thanks in advance!

0 Replies