firebase-tools
firebase-tools copied to clipboard
Unable to switch emulators local url after changing project
[REQUIRED] Environment info
firebase-tools: 14.7.0
Platform: Windows
[REQUIRED] Test case
Initialize a firebase project, with functions and the functions emulator enabled. Start the emulator. Local url is correct here. Shut the emulator down, change use another firebase project, then relaunch the emulator. Functions will still be using the id of the previous project.
Note: I am using single project mode, and have checked the .firebaserc file and the id is correctly set to the new project.
[REQUIRED] Steps to reproduce
I am unable to switch the local url of the functions emulator. The firebase project folder was previously pointing to another firebase project, and has been changed. But when launching the emulator, the functions still use the previous project Id in the url
[REQUIRED] Expected behavior
http://127.0.0.1:5001/new-project-id/location-name/functionName
[REQUIRED] Actual behavior
http://127.0.0.1:5001/old-project-id/location-name/functionName
Hey @Cruzor-Blade, I'm trying to reproduce the behavior you mentioned but so far haven't encountered the issue. The url for the functions are using the correctly set project ID.
Just to verify, are the steps to reproduce the issue:
- Run
firebase init functions --project OLD_PROJECT_ID- Uncomment the default https function code
- Run
firebase init emulators - Run
firebase emulators:start- Function url is
http://127.0.0.1:5001/OLD_PROJECT_ID/us-central1/helloWorld
- Function url is
- Shut down the emulators
- Run
firebase use --add NEW_PROJECT_ID --alias staging - Run
firebase emulators:start- Functions url is
http://127.0.0.1:5001/NEW_PROJECT_ID/us-central1/helloWorld
- Functions url is
Let me know in case I'm missing a step here, or if I misunderstood the issue.
The firebase project folder was previously pointing to another firebase project, and has been changed
Try running firebase use to get a list of project IDs and aliases you have in your working directory. If you see the project ID you want to use, run firebase use PROJECT_ID or firebase use ALIAS to switch to that project.
Hey @Cruzor-Blade. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Hey @Cruzor-Blade - we actually track what project is active in Configstore. Can you check ~/.config/configstore/firebase-tools.json? The 'activeProjects' field of that file will have a mapping of directories to active projects - I suspect that your current directory is still pointing to the old project there.
Hey @Cruzor-Blade. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@Cruzor-Blade if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.