-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix service account for firebase prod. #8422
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Thank you for looking into this, @leoxs22 ! I'm going to see who I can get to look further into this on our end in case someone has any extra insight before we go ahead and publish this. Hang tight, and thanks for helping! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK @leoxs22 , since no one seems to have anything better, and you're confident that this at least doesn't produce an error, I'm going to go with you here and let's get this published and helping people! 🙌
Signed-off-by: Thomas Bonnet <[email protected]>
* i18n(fr): Update guides/astro-db from #8478 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/backend from #8450 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/backend/google-firebase from #8422 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/cms/apostrophecms from #8480 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/cms/builderio from #8259 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/cms/directus from #8647 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/cms/ghost from #8518 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/cms/statamic from #7119 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/content-collections from #8447 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/data-fetching from #8210 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/deploy/cloudflare from #8421 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/deploy/netlify from #8233 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/deploy/render from #8233 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/deploy/vercel from #8217 (and fix little typos) Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/environment-variables from #8533 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/environment-variables from #8611 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/images from #8447 #8646 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/integrations-guide from #8575 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/integrations-guide/cloudflare from #8211 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/integrations-guide/lit from #8270 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/integrations-guide/markdoc from #8167 (Steeeeps) Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/integrations-guide/preact from #8644 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/integrations-guide/react from #8038 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/integrations-guide/vue from #8295 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/markdown-content from #7218 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/markdown-content from #8167 #8239 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/middleware from #8572 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/prefetch from #8246 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/routing from #8466 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/rss from #8632 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/testing from #8369 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update guides/view-transitions from #8646 Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Fix typo in routing.mdx Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Fix links ? Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Fix badge Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Fix badge Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Fix tabs Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Fix tabs Signed-off-by: Thomas Bonnet <[email protected]> * Update src/content/docs/fr/guides/environment-variables.mdx Co-authored-by: pioupia <[email protected]> * Update src/content/docs/fr/guides/integrations-guide/lit.mdx Co-authored-by: pioupia <[email protected]> * Update src/content/docs/fr/guides/integrations-guide/vue.mdx Co-authored-by: pioupia <[email protected]> * Update src/content/docs/fr/guides/markdown-content.mdx Co-authored-by: pioupia <[email protected]> * Update src/content/docs/fr/guides/middleware.mdx Co-authored-by: pioupia <[email protected]> * Update src/content/docs/fr/guides/testing.mdx Co-authored-by: pioupia <[email protected]> * Update src/content/docs/fr/guides/testing.mdx Co-authored-by: pioupia <[email protected]> * Update src/content/docs/fr/guides/testing.mdx Co-authored-by: pioupia <[email protected]> * i18n(fr): Fix links Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): Update `tutorial/6-islands` because CI links err Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): fix links Signed-off-by: Thomas Bonnet <[email protected]> * i18n(fr): fix links Signed-off-by: Thomas Bonnet <[email protected]> --------- Signed-off-by: Thomas Bonnet <[email protected]> Co-authored-by: pioupia <[email protected]> Co-authored-by: Yan <[email protected]>
Description (required)
The current recommended configuration produces an error when deploying to Firebase. Randomly, the server will return Service unavailable, saying that project_id is undefined when loading the site. After reloading the site a few times it will load, but it will break again after some inactivity (I guess is when firebase shut downs the function) or after a new deploy.
It is pretty random, so it was extremely hard to find what was causing the error. I'm still not sure, but I'm sure this fixes it. My best guess is:
meta.env vars are solved in build time, when running this on a CI, it won't find anything so it will end up as a proccess.env, waiting for the var to be solved in runtime. Firebase already has a default account loaded in every enviroment, so just calling
initializeApp()
without anything works perfectly, but the env vars are not available. I'm not sure why after 4 reloads it works, it might be because Firebase loads the env vars but with a delay, or maybe because the app is created with a delay so it ends up ingetApps()
In any case, calling the initialize without parameters is the recommended way to initialize it in production, so I would say this is the best approach
(btw, firebase recently released app hosting which seems to be for SSR, I haven't tried it yet, but it might change a lot of things)