Skip to content
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

multiple hosting sites with emulator #2570

Open
ZYinMD opened this issue Aug 23, 2020 · 12 comments
Open

multiple hosting sites with emulator #2570

ZYinMD opened this issue Aug 23, 2020 · 12 comments

Comments

@ZYinMD
Copy link

ZYinMD commented Aug 23, 2020

If I configure multiple hosting sites with "deploy targets", and run the emulator, there are 2 problems:

  1. The emulator UI will only show the link to the default site (the one at https://project-id.web.app). The other site(s) are served, but no link is shown. This should be an easy fix. (btw if you googled your way here, please know they're indeed served, good news right?)
  2. Only the port for the main site is customizable in firebase.json, the other sites will get auto assigned ports (they seems to start from main site +5, then +6 +7), there's no way to customize.
@yuchenshi yuchenshi transferred this issue from firebase/firebase-tools-ui Aug 24, 2020
@ZYinMD
Copy link
Author

ZYinMD commented Sep 5, 2020

edited because issue was moved from the firebase-tools-ui repo to this repo.

@ZYinMD ZYinMD changed the title Support multiple hosting sites multiple hosting sites with emulator Sep 5, 2020
@kmcnellis kmcnellis self-assigned this Oct 2, 2020
@neekey
Copy link

neekey commented Dec 28, 2020

any update to solve this issue yet?

@danmt
Copy link

danmt commented Mar 31, 2021

@ZYinMD I had the same issue. I solved it for my use case with the --only option. I run emulators this way:

firebase emulators:start --only "hosting:<target>" --project <projectId>

In my case, each site belongs to a different project but I suppose you can avoid the --project option, and firebase defaults to the project's default in .firebaserc. Hope that helps.

@motiejunas
Copy link

kmcnellis self-assigned this on 3 Oct 2020
kmcnellis unassigned kmcnellis on 28 Dec 2020

okay... 😃

@gpfister
Copy link

Hi ! I have the same reqest, in particular to test (and include in CI workflow) cross web app integration. Many thanks in advance.

@rcb4t2
Copy link

rcb4t2 commented Feb 15, 2022

+1 from us! We need to be able to specify an emulator port for each of the hosting targets defined in our config

In our use case, we have rewrites to triggered functions on one of our hosting targets. In order to test in development, we have to duplicate those rewrites over to the main target. Since we assign the url's programmatically, it's not feasible to fetch the port from the firebase-tools console output

@kuechlerm
Copy link

Hi. Any updates here? I would really like to have this for testing purposes.

@s2young
Copy link

s2young commented Nov 17, 2022

+1

@charlesgreen
Copy link

Hi, Any updates? This would be helpful for testing.

@charlesgreen
Copy link

Hi @bkendall, I'm interested in contributing. Is the team open to receiving a PR for these changes?

@bkendall
Copy link
Contributor

Yeah, I think we can review a PR. I'm not 100% sure what the best solution would look like off the top of my head, but I'd be happy to work on that in a PR (though, be warned, my CLI time is pretty limited these days so I'm sorry if I'm not immediately responsive)

@mvarchdev
Copy link

mvarchdev commented Aug 2, 2023

Hello all, Is there any update? I have an issue when I have --project demo-.... prefix with using emulators, that I am not able with any tryings to get emulators with multi site running.

When I use target in more hosting entries in firebase.json, this error shows up:

Error: Deploy target ***-cms not configured for project demo-***. Configure with:

  firebase target:apply hosting ***-cms <resources...>

When I use site attribute, this error shows up:

Error: could not find sites for project "demo-glassfinder"

Command I am using:

firebase emulators:start --project demo-***

I have this in my firebase.json as I am using devenv folder with only one emulator running with multiple sites:

  "hosting": [
    {
      "site": "***-frontend",
      "source": "src/***-frontend"
    },
    {
      "site": "***-cms",
      "source": "src/***-cms"
    }
  ],

Any suggestions? Thanks in advance.

@charlesgreen @bkendall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests