Download PDF to Firebase repository - Unacceptable error: this browser does not seem to support Blobs creation

Trying to upload both the image file and the pdf file to the Firebase repository, loading the image works fine, and loading the pdf file with a very similar return code

Missed Error: This browser does not seem to support Blobs creation.

NodeJS, ReactJS

Please see below code

// post resume to firebase function PostResumeToFirebase(id, resume){ console.log("inside PostResumeToFirebase -------") resume.resume_files.forEach((data) => { console.log("file inside post resume", data) const file = data var storageRef = firebase.storage().ref() // Upload file and metadata to the object const uploadTask = storageRef.child('applicants/resume/' + file.name).put(file); // Listen to state changes, errors, and completion of the upload. uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, function(snapshot) { // Get task progress, inlcuding number of bytes uploaded and the total number of bytes to be uploaded var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100; console.log('Upload is ' + progress + '% done'); switch (snapshot.state) { case firebase.storage.TaskEvent.PAUSED: // or 'paused' console.log('Upload is paused'); break; case firebase.storage.TaskState.RUNNING: // or 'running' console.log("Upload is running"); break; } }, function(error){ switch (error.code) { case 'storage/unauthorized': // User doesn't have permission to access the object console.log("storage/unauthorized", error) break; case 'storage/canceled': // User canceled the upload console.log("storage/canceled", error) break; case 'storage/unknown': // Unknown error occurred, inspect error.serverResponse console.log("storage/unknown", error) break; } }, function(){ // Upload completed successfully, now we can get the download URL var downloadURL = uploadTask.snapshot.downloadURL; console.log("link to image", downloadURL) let resumeData = { user_id: id, resume_pdf: downloadURL } // PostPdf(resumeData) }) }) } function PostPdf(resumeData) { console.log("line 937", resumeData) $.post('https://atlas-cv-database.herokuapp.com/api/applicants/upload_pdf', resumeData) .done((data) => { console.log("yay!!! resume posted ---", data) }) .error((error) => { console.log("noooooooooooooo") }) } 
+8
reactjs uncaught-typeerror firebase firebase-storage
source share
3 answers

I encountered the same problem in the last 24 hours, but in Ionic v2 / Angular 2 / TypeScript.

 this.dbsref = firebase.storage().ref(); // ... other code ... this.dbsref.child(picPreviewName).put(byteArray).then(() => { console.log("Success!"); }); 

Uncaught Error: This browser doesn't seem to support creating Blobs

I can’t even upload an image. If I find permission, I will definitely be updated here.

Update Yes, I found the problem and fixed it. There are three files in node_modules/firebase/ : firebase-storage.js , firebase.js and storage.js . They are minified by JavaScript. In all of them, search for n(l.Blob) and replace it with n(Blob) . For some reason, the object l does not have the Blob property. Blob is global, so it can just check there. This is a dirty hack, but it seems to be a Firebase bug.

+6
source share

I have the same problem on firebase@3.6.2 , I downgraded to firebase@3.5.3 , and now everything is in order.

+2
source share

Just like I had above it, I had the same problem on firebase @ 3.6.2 I upgraded to firebase@3.6.4 and I can no longer replicate the error.

0
source share

All Articles