firebase-tools: Error: Hosting target (project-name) not detected in firebase.json
[REQUIRED] Environment info
**firebase-tools:**v8.13.1
**Platform:**macOS
[REQUIRED] Test case
firebase deploy --only hosting:(project-name)
[REQUIRED] Steps to reproduce
I’m using the following Github action: https://github.com/w9jds/firebase-action/ which uses the latest release of firebase-tools. Since the last update, it’s not working anymore. I had to manually set to an older version of firebase-tools (I went for v8.12.1, I haven’t tried with v8.13.0)
[REQUIRED] Expected behavior
Successful deploy
[REQUIRED] Actual behavior
Deploy error Error: Hosting target (project-name) not detected in firebase.json
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 35 (6 by maintainers)
Commits related to this issue
- fix: firebase hosting `site` variable see https://github.com/firebase/firebase-tools/issues/2731 — committed to momargoh/diario by momargoh a year ago
- fix: firebase hosting `site` variable see https://github.com/firebase/firebase-tools/issues/2731 — committed to momargoh/diario by momargoh a year ago
Worked for me, this way (specific firebase-tools version 8.12):
Then:
npm install -g firebase-tools@8.12Then:firebase deploy --only hosting:project-nameworks for meI am able to replicate this with
firebase deploy --only hosting:<project>. Taking a look…Ack. Thanks everyone for the insights. If we regressed this behavior, makes sense to me that we should restore it. I’ll look into it this morning.
works for me as well
only open the directory and open firebase.json
and add “site”: “site-name”
below the second line “hosting”
Follow https://firebase.google.com/docs/hosting/multisites#set_up_deploy_targets
TL;DR
firebase target:apply hosting blog myapp-blogit solved the problem for me with multiple sites in one hosting project
Same here. I’ve always used
firebase deploy --only hosting:<name>Thanks for the tip man! I only got notifications about new posts by mail and that’s fine but here I wanted to reply back to say that my problem was not really a problem at all but a PEBKAC but I could not find the issue thread any more… 😄
I had the same problem: Hosting target (project-name) not detected in firebase.json
I looked at .firabaserc and get the target name
targets": { "XXXXX": { "hosting": { "Teste": [ "XXXXX" ] } }Then, I ran
firebase deploy --only hosting:XXXXXand it worked.@bkendall How should hosting be specified until a fix is up?
I was presented with the same problem and using an older version of firebase-tools solved the problem. Thanks for your comments. Greetings.
Same here… since two days I am using
deploy -P <PROJECT> --only hosting:<SITE NAME>I’ve had this same problem start happening from last night. I use the following in my CI pipeline:
I now get the error:
Nothing else has changed on this project or CI defintion for months
Question for you @pflevy -
on
v8.12.1, I actually cannot directly dofirebase deploy --only hosting:<project-name>. The--only hosting:<target>syntax is actually for deploying to Hosting targets in a multi-site setup. More information on that: https://firebase.google.com/docs/hosting/multisites#cli-commands-with-deploy-targetsDo you have those targets set up and are you using the correct name? I can poke around a bit more, but specifically doing
--only hosting:<SITE-name>(which may be the same as the project name) is not supported.