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

Still not a clean shutdown on the emulators even when noting @simondotm/nx-firebase:serve #249

Open
stevebrowndotco opened this issue Oct 6, 2024 · 0 comments

Comments

@stevebrowndotco
Copy link

stevebrowndotco commented Oct 6, 2024

(nx 19, node 20.17.0)

Hello, I love this extension but I am having issues. I noticed that here https://github.com/simondotm/nx-firebase/blob/main/docs/nx-firebase-emulators.md that you are using your own script to attempt to properly do a clean shutdown of the firebase emulators.

I can confirm this isn't working, and also as discussed here #238 the process shuts down immediately, and one of the projects spits an error code 128. The result of this that the emulators dont finish properly, and the --export-on-exit functionality incorrectly saves the data in the monorepo root not the project .emulator folder (and duplicates each time).

I have a workaround for now to use run-p from npm-run-all for the scripts directly in the package json (I tried using concurrently but that doesnt do a clean shut down either).

So for now I have commented out emulators in project.json:

    "serve": {
      "executor": "@simondotm/nx-firebase:serve",
      "options": {
        "commands": [
          "nx run project:watch"
          // "nx run project:emulate"
        ]
      }
    },

and updated my run script like so: (End goal is to simply run only project:dev script, and to not touch the others)

Package.json

//
"scripts": {
   "project:dev": "run-p project:emulate project:main"
   "project:main": "nx nx-main-project"
   "project:emulate": "yarn project:close-ports && firebase emulators:start --import=apps/nx-firebase-project/.emulators --export-on-exit"
   "project:close-ports": "nx killports nx-firebase-project"
}
//

This provides a clean shutdown

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

No branches or pull requests

1 participant