Zeit deployment fails with FirebaseErrorApril 19, 2020 at 2:53pm
Following the instructions given in README for zeit deployment, we get this error. What might be going on?
Build error occurred 07:51:01.155 Error [FirebaseError]: projectId must be a string in FirebaseApp.options 07:51:01.155 at new FirestoreError (/zeit/5f1f526a/node_modules/@firebase/firestore/dist/index.node.cjs.js:355:28) 07:51:01.155 at Function.Firestore.databaseIdFromApp
April 19, 2020 at 4:31pm
April 20, 2020 at 2:45pm
Okay, I believe I have a fix for you here. Remove the REACTAPP prefix from all keys in both .env and now.json.
keys in next.config.js should look like
REACT_APP_FIREBASE_API_KEY: process.env.FIREBASE_API_KEY,REACT_APP_FIREBASE_AUTH_DOMAIN: process.env.FIREBASE_AUTH_DOMAIN,etc...
So next.config.js is the file responsible for prefixing vars to use client-side with REACTAPP
.env provides local env values, now.json provides production env values
And your secrets in now should not have the prefix either
Let me know if that does the trick