I'm using the firebase emulator suite including the cloud functions emulator, on an angular/fire project. firebase tools 9.23.1. Typescript version 4.5.4. In package.json
the main property is "main": "lib/index.js",
Development environment is MacOS 12.1.
I run tsc -w
to watch the functions project's src folder and transpile on any changes. Then I start the emulator using firebase emulators:start
. The emulator suite succeeds in starting, and the cloud functions run with the code contained in the functions at start time.
And when I save a change to the code in a .ts file in /src, the .js file in the main folder immediately reflects those changes; tsc -w
seems to be watching and transpiling as expected.
But when I call emulated functions after that, they still run the old code, from before the save and transpile. Cloud firestore's documentation says:
Note: Code changes you make during an active session are automatically reloaded by the emulator. If your code needs to be transpiled (TypeScript, React) make sure to do so before running the emulator. You can run your transpiler in watch mode with commands like tsc -w to transpile and reload code automatically as you save.
I don't know what I'm missing here. I get the same behavior whether I use scripts to launch the watcher and emulator or if I do it by hand. I've also tried using firebase serve --only functions
and firebase serve:shell
with no luck. Is there a flag I need to use on firebase emulators:start
to convince the emulator to watch for changes?