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

getconfig produces broken config #164

Open
ciriousjoker opened this issue Oct 23, 2023 · 5 comments
Open

getconfig produces broken config #164

ciriousjoker opened this issue Oct 23, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ciriousjoker
Copy link

ciriousjoker commented Oct 23, 2023

  1. Deleted any previous configs just to be sure.
  2. Command used: npx nx run firebase:getconfig
  3. Result:
    CleanShot 2023-10-23 at 02 41 09@2x

Easy fix for a human though, so low priority.

context: I'm using VSCode's inline terminal, but this shouldn't matter

@simondotm simondotm added the bug Something isn't working label Nov 5, 2023
@simondotm
Copy link
Owner

@ciriousjoker This is a good one. Thanks for reporting.

It's been a while since I used function configs (and probably in a much older 13.x era version of Nx before they added the fancy console output), so I haven't used it myself lately.

So the problem is that any kind of pipe of output in an nx run captures the Nx console stdout also.
nx -q run quiet mode is no use because it suppresses everything.

I dont see any other way to be able to capture command output to a file in Nx.

I note your PR comment about preserving --config & --project for firebase CLI, which ideally we want to do, so the best solution I can think of is to:

  1. Don't try to pipe output direct to the .runtimeconfig file, instead:
  2. Log the JSON to stdout, and prompt with echo for user to copy that JSON to their .runtimeconfig file instead

@simondotm
Copy link
Owner

simondotm commented Nov 6, 2023

On a related note, I believe the general trend for Firebase is going to be sunsetting function configs and moving to environment vars instead. They already state that v2 cloud functions do not support function configs.

This isn't ideal, as I was toying with using function configs on a personal project just last week to dodge the secrets billing (only 6 for free, Google? come on!). And yeah I know its cheap, but so am I. 😅

But, no can do, because I'm using v2 cloud functions.

End of side track.

@ciriousjoker
Copy link
Author

Yes, V2 Cloud functions use a different way of managing configs, but for older projects, a working runtimeconfig is probably better than one for the correct NX project, bit broken. Therefore I'd personally still merge it, but aside from that idc since on our project this is solved manually anyway :)

@simondotm
Copy link
Owner

Yeah, life is never that simple for plugin dev though because we have to be mindful of user experience and migration paths etc.
No biggie, just part of the process. I'll take a look at this soon.

@mackelito
Copy link

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants