Firebase would not let me create a distroav
project name.
I am guessing it might have already been taken, but I cannot seem to find anything existing & in use.
So, I created the project distroav-1337
, which resulted in Firebase Hosting urls of:
These urls look a little unofficial (aka: "sus").
I set up Firebase Hosting distroav-1337
to use the official distroav.org
domain name.
I later [re-]discovered that Firebase Hosting supports multiple sites.
To my surprise it let me create a much less sus distroav
hosting site:
- https://distroav.web.app/
- https://distroav.firebaseapp.com/
(So now I am even more curious why Firebase would not let me create a project named
distroav
.)
I moved distroav.org
to be hosted by this second less-sus distroav
site.
The point is that using these secondary hosting site affects how firebase hosting should be deployed.
Normally you would just deploy hosting with:
% firebase deploy --only hosting
With multiple sites you have to do it this way:
# Once; configure the hosting target name
# firebase target:apply hosting TARGET_NAME SITE_ID
% firebase target:apply hosting prod distroav
% firebase target:apply hosting dev distroav-1337
# Test Development
% firebase emulators:start --only firestore,functions,hosting:dev
# Deploy Development
% firebase deploy --only firestore,functions,hosting:dev
# Test Production
% firebase emulators:start --only firestore,functions,hosting:prod
# Deploy Production
% firebase deploy --only firestore,functions,hosting:prod
References:
- https://firebase.google.com/docs/hosting/full-config
- https://firebase.google.com/docs/hosting/multisites#set_up_deploy_targets
- https://fireship.io/lessons/deploy-multiple-sites-to-firebase-hosting/
- If you are getting...
TypeError: Cannot read properties of undefined (reading 'getTime')
...and you are running node v22, this is a known issue. Runnvm use 20
to use node v20.
The.nvmrc
in the project root is supposed to take care of this.