hidjou / classsed-react-firebase-functions

327 stars 180 forks source link

user/image Internal Server Error #24

Open ironspur5 opened 4 years ago

ironspur5 commented 4 years ago

Receiving a 500 internal server error when trying to upload a new image to a user. Added .bucket(${config.storageBucket}) to admin to specify the bucket, but no luck. Anyone else solve this issue?

KathirvelChandrasekaran commented 4 years ago

In the console, you can see a URL from firebase. Using the URL download the JSON file and place it in the function folder. Then change the below code in the admin.js

var admin = require('firebase-admin');
var serviceAccount = require('JSON File Path');

admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: 'https://my-project.firebaseio.com', storageBucket: "my-project.firebaseio.com", });

faisalsayed10 commented 3 years ago

Hi! I'm facing this issue too, But @KathirvelChandrasekaran I'm a bit confused by your answer. which "console" and "url" are u talking about?

KathirvelChandrasekaran commented 3 years ago

@faisalsayed10 here console is Terminal tab in VS code and FIrebase will provide URL to download the json file.

The-big-boy commented 3 years ago

Receiving a 500 internal server error when trying to upload a new image to a user. Added .bucket(${config.storageBucket}) to admin to specify the bucket, but no luck. Anyone else solve this issue?

Ok for me the solution was that the package.json in my functions folder didn't have the busboy dependency for some reason... i had to update the package.json and the package.lock.json and its working now!