I followed the tutorial to set up Firebase Functions with Typescript at
https://firebase.google.com/docs/functions/typescript
However, when I run npm run serve
or firebase emulators:start
, emulators won’t start, but I’m getting the following error:
[2023-03-25T09:04:16.875Z] /Users/username/.cache/firebase/emulators/ui-v1.11.4/server/server.js:569
re"use strict";
^^^^^^^^^^^^
I have tried deleting the cache folder, with no effect. In the file server.js, the relevant lines are:
function createDebug(namespace) {
function debug2() {
if (!debug2.enabled)
re"use strict";
Installed versions of the relevant libraries are:
firebase --version
11.25.1
node -v
v16.19.1
npm -v
8.19.3
java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment Homebrew (build 19.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.2, mixed mode, sharing)
tsc --version
Version 5.0.2
I’m out of ideas what to try, or what to reinstall. Any suggestions what I’m doing wrong?
I tried reinstalling all libraries, set up a new firebase project, installed the correct node version, reinstalled jdk. Was expecting emulators to run.
4
Answers
I had the same issue
I fixed it with a flag:
In firebase.json, set
It Works for me!
Regards
I had the same issue as you. I raised the following ticket on Firebase. Was facing this on MacOS (and Linux), but I assumed it’s an issue with the Node version I was using (not being LTS).
Issue:
After some investigation the following elements are the cause of the issue.
Resolution:
To resolve it I amended the host environment to use compatible versions as described above. The Node + Java components are the ones that are important.
On my device, the following setting allowed the Emulator UI to run successfully.
I then deleted the machine cache located:
Then restart the emulator
Here is the copy-paste solution from Richard Rose’s bug ticket:
None of the suggested solutions worked for me, I had to manually unzip
~/.cache/firebase/emulators/ui-v1.11.5.zip
I found this solution on the github issue