iamshaunjp / firegram

Starting & final course files for the FireGram tutorial (React, Firebase & Framer Motion) on Brad Traversy's YouTube channel.
303 stars 249 forks source link

Firebase Storage: Invalid argument in `put` at index 0: Expected Blob or File #3

Open fangqiank opened 4 years ago

fangqiank commented 4 years ago
screencapture
fangqiank commented 4 years ago

In the component 'uploadForm':

if (selected && types.includes(selected.type)) { setFile(selected); console.log(file instanceof File); setErr(""); } else { setFile(null); setErr("Please select an image file (png or jpg)"); } };

截屏2020-08-01 下午1 46 32
lucasbarroso23 commented 4 years ago

Hello, i had this error and the problem for me was: i set up the wrong database in the firebase, instead of setting up the "Cloud firestore" i did it with the "Realtime Database", so i just initialized a database in the right one and worked just fine.

m2paulc commented 4 years ago

Getting this error now when adding the document to a collection. Would this be related to a firebase promise? rules are to allow anyone to read and write.

index.js:1 Uncaught Error in onSnapshot: FirebaseError: Missing or insufficient permissions. at new n (http://localhost:3000/static/js/0.chunk.js:12316:19) at http://localhost:3000/static/js/0.chunk.js:23499:18 at http://localhost:3000/static/js/0.chunk.js:23500:10 at n.onMessage (http://localhost:3000/static/js/0.chunk.js:23548:6) at http://localhost:3000/static/js/0.chunk.js:23411:18 at http://localhost:3000/static/js/0.chunk.js:23449:29 at http://localhost:3000/static/js/0.chunk.js:20931:25