Open paulpv opened 3 months ago
Hey @paulpv, thanks for the detailed report. I was able to reproduce this issue when using PowerShell, however, when I tried using Command Prompt, the command firebase emulators:start --only firestore,hosting
works and does not raise any errors.
When using the Command Prompt, checking the generated firebase-debug.log
shows that the command being run is:
C:\<PATH>\firebase.js emulators:start --only firestore,hosting --debug
However, when using PowerShell, I checked the generated firebase-debug.log
file and noticed that the command being run is:
C:\<PATH>\firebase.js emulators:start --only firestore hosting --debug
I noticed that the “,” separating firestore
and hosting
has been removed. This makes me think that this could be an issue with how PowerShell treats commas. I found this relevant Stack Overflow post.
Could you try adding quotes around the argument to see if you would be able to start the emulators? The command would look something like:
firebase emulators:start --only 'firestore,hosting' --debug
Could you try adding quotes around the argument to see if you would be able to start the emulators? The command would look something like:
firebase emulators:start --only 'firestore,hosting' --debug
Purfect! Works just fine now!
I had a feeling it had something to do with the commas!
"Today I learned" that PS treats commas differently.
Hopefully this helps out anyone in the future that runs into this!
You may close as appropriate.
The only thing I could think of is maybe some example/mention in the docs on how to handle this.
PowerShell is being pushed more and more as the default Windows shell/terminal.
WindowKey and searching for "cmd" doesn't even bring up "Command Prompt" anymore. :/
Awesome! It’s good to hear that the command now works. For now, I’ll go ahead and close this issue as it’s solved. Though, I’ll bring this up to our engineering team to see if we could update the docs.
Quick update, re-opening this issue. Discussed this with our engineering team and we think we could add some logic to handle how PowerShell treats commas. I'll change the title of the issue to match this.
[REQUIRED] Environment info
firebase-tools: 13.14.2
Platform: Windows
[REQUIRED] Test case
...
[REQUIRED] Steps to reproduce
Setup: PowerShell v7 Administrator:
Close and reopen PowerShell (Admin), then:
[REQUIRED] Expected behavior
Emulator starts
[REQUIRED] Actual behavior
Notes
Everything works fine if I run just:
or even just
Seems like anything comma-separated
--only a,b
does not work.This is using an existing project that runs fine on Mac/Linux, when I use
--only firestore,functions,hosting
.Log of a successful non-
--only a,b
command: