-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Has anyone successfully deployed yet? #343
Comments
@greg234234 it looks like something wrong with the build output. You may want to open the file that Firebase is complaining about inside of the
Can you try Note that there should not be |
@koistya Thanks for your response. I think it's definitely related to the Firebase Service Key. On that line referenced in the error, we see it complaining about: JSON.parse(process.env.GCP_SERVICE_KEY) Inside ".env", GCP_SERVICE_KEY and FIREBASE_CONFIG are using the same JSON dictionary from https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk Forgive me, some follow-up questions. When submitting the information like so:
Sorry for all the questions, thanks for your insights 👍 (yarn relay && yarn build ran without issue but didn't resolve it) |
@greg234234 you can find GCP service key on this page: It's the same key known as Firebase Admin SDK in Firebase Console and it gives you more permissions than default credentials. For example, it allows doing things like You just click [Copy] icon in Google Cloud Console next to the server-side key, then serialize it into a string (e.g. by copying it into browser's console:
You do not need to use Google App Engine, the app is supposed to be deployed to Firebase Functiosn (Google Cloud Functions). You can set Most likely you would have two (or, more) projects in GCP/Firebase, e.g. |
@greg234234 BTW, I would be grateful if you would add missing info into the Deployment wiki page after figuring this thing out. |
@koistya Yes, I'll be glad to update the Deployment wiki. From which branch do I make the PR?
Referring to the string from the image you shared, JSON.stringify just adds an extra set of quotes around the string. I've been applying JSON.serialize to both strings, from Service Account key, and the Server Key, without success. So I'm writing to confirm it. On my credentials page, I have 4 items: the Server key, Browser key (both auto created by firebase), OAuth, and the Service Account key which is another string of the same shape/size belonging to the service account named "firebase-adminsdk". This brings me to the JSON string for that service account, as shown in the example .env file:
Trying to make sense of the JSON error from server.js I wonder, do we JSON.stringify part or all of this JSON for
Where line 764 is |
Small update, relating to my last point...
I went to this page https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk and clicked "Generate new private key", saved it, and ran JSON.stringifiy on it. Feeding that to app.gcp_service_key in firebase config:set returns the following error: |
@koistya please could you confirm, you mentioned using the server-side key for the app.gcp_service_key field in the firebase configuration command. The server-side key isn't a JSON object needing to be stringified, I've tried to come forward with the best guess, and that configuration comes with another error. |
Trying to debug this line 764 in './app/build/server.js
I've added this line
This is because I have "t" for "type" starting the JSON, as we see in the examples So what are they expecting for position 1 of that JSON? |
@greg234234 you may need to check what has been written to Firebase env by running: $ firebase --project=<PROJECT> functions:config:get It should return something like this:
You can update $ firebase --project=<PROJECT> functions:config:set \
app.gcp_service_key='{"type":"...",...}' |
A full tutorial on handling variables or at least helpful links would be useful. I for some reason couldn't add firebase to created google project, so had to restart with a new one created through firebase console (I blame adding admin service key). |
In case anyone is still having this issue I figured it out. Check out this documentation page: What I did was just split up the admin key into 3 ENV variables. |
Hi,
I just start using the starter and it works great, awesome react starter. I've configured everything in firebase.google.com and .env files, following the readme and deployment guide here: https://github.com/kriasoft/react-firebase-starter/wiki/deployment.
But my problem is that when I want to build and deploy, no html files are produced, not even index.html. I've not modified anything except for .env file.
I've logged the details below, anonymizing them with < your site > and < your project > labels.
node: 10.16.0, npm: 6.9.0
Comments: the app exists with firebase.google.com, not with cloud appengine though
comments: works fine, it registers and loads images and favicon.ico to the remote firebase server, but no html files are produced inside ./build/public
This produces the same result as deploying to firebase servers,
The text was updated successfully, but these errors were encountered: