firebase-tools-ui: Firebase Emulator Suite UI unable to start
Note: Before filing bugs in this repo, please ensure that this is a bug for the Emulator Suite UI. Emulator Suite and/or Firebase CLI bugs should be filed under the firebase-tools repo here: https://github.com/firebase/firebase-tools/issues/new/choose
Describe the bug A clear and concise description of what the bug is.
This issue on stackflow covers the error I am seeing when acccessing the Emulator UI https://stackoverflow.com/questions/75840698/i-cannot-run-firebase-emulators-on-fresh-install-getting-syntaxerror-unexpec
To Reproduce Steps to reproduce the behavior:
I am using a fresh install of Firebase tools on Mac.
firebase --version
11.25.1
MacOS
13.2.1 (22D68)
firebase emulators:start results in a UI error logged
/Users/r/.cache/firebase/emulators/ui-v1.11.4/server/server.js:569
re"use strict";
^^^^^^^^^^^^
SyntaxError: Unexpected string
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1195:20)
at Module._compile (node:internal/modules/cjs/loader:1239:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
Node.js v19.8.1
Expected behavior Should be able to start the Firebase Emulator suite UI
Screenshots N/A
Desktop (please complete the following information):
- OS: MacOS 13.2.1
- Browser: ChromeOS
- Version: 111.0.5563.110
Smartphone (please complete the following information):
N/A
Additional context New Flutter project added Authentication and Cloud Firestore emulator components. npm: 9.5.1 node: 19.8.1 openjdk version “11.0.18” 2023-01-17 OpenJDK Runtime Environment Homebrew (build 11.0.18+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.18+0, mixed mode)
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 13
- Comments: 41 (2 by maintainers)
Commits related to this issue
- Fix image https://github.com/firebase/firebase-tools-ui/issues/933 — committed to multani/firestore-emulator by multani a year ago
- Test & fix the Docker image (#10) The current image is broken, apparently due [to a version of Node JS too recent](https://github.com/firebase/firebase-tools-ui/issues/933). The buggy version used... — committed to multani/firestore-emulator by multani a year ago
- Update to latest Lighthouse CLI (#736) * Force use of Node v18.15, as workaround for issue under v18.16 (see https://github.com/firebase/firebase-tools-ui/issues/933) — committed to jpchase/lineup-tracker by jpchase a year ago
- Fix base image The Firestore UI doesn't build on node >= 18.16 See: https://github.com/firebase/firebase-tools-ui/issues/933 — committed to multani/firestore-emulator by multani a year ago
- Fix base image (#18) The Firestore UI doesn't build on node >= 18.16 See: https://github.com/firebase/firebase-tools-ui/issues/933 — committed to multani/firestore-emulator by multani a year ago
- Pin Docker image version to < 18.16 See https://github.com/firebase/firebase-tools-ui/issues/933 — committed to multani/firestore-emulator by multani a year ago
Copy & Paste Solution:
I downgraded my node to LTS
v16.19.1
and flushed the cache. That did the trick - I can now start the emulator on my device.flush the cache
Only thing that worked for me was to go to
~/.cache/firebase/emulators/ui-v1.11.5
and manually unzipui-v1.11.5.zip
there.For those who is struggling with this issue, please read my comment here: https://github.com/firebase/firebase-tools/issues/5614#issuecomment-1508515106 to understand what’s going on.
How to fix: Essentially you need to make sure you installing your emulators using node 18.15.0 or lower. If you have your emulators installed using higher version of node: remove it from cache folder (usually
~/.cache/firebase
).Unfortunately it’s not very easy to install a specific node version in your docker container. In the comment I shared my dockerfile to provide an idea of how to install it with nvm.
CC @DevDaveFrame @Durisvk
Hi @rosera, I believe Java version is not important, replying to:
PS: One more comment about LTS version as a solution: No, it won’t work and if this does work it’s sheer luck, because what really happens is:
good
version of node (v18.15.x/v19.7.x or lower) .LTS
node from is still giving you v18.15.0 and not v18.16.0 which is the latest one as of today and running on whichfirebase-tools
struggle to unzip downloadedPubSub
&UI
emulators.CC @christhompsongoogle
Downgrading to Node 18 and clearing the cache as decribed above (copied here for signal boost) seems to resolve the issue. Node 19 is an experimental release. I’m still not clear why the cache clear is required though. There’s a new release of the UI coming out this week that may resolve it.
I get the exact same error on my Mac. Even after following the instructions by @christhompsongoogle. Node 19 or 18, and deleting cache, produces the same error.
Running NodeJS 18 and
firebase-tools
11.27.0 here. Tried manually clearing the cache, unfortunately that didn’t help. Unzipping the cache myself did work though, for some reason.Looking at the difference between the 2
server.js
files, there’s, what looks to me, like some transpilation/bundling that’s happening differently.Same - issue occurs for me. Using firebase-tools v12.5.3.
Downgrading to Node v18.15 fixed it.
Thank you all for the reports - this is caused by a break in our unzipper library dependency. We have a fix pending from Durisvk and are trying to get that in ASAP to resolve this issue.
Workaround:
In my case I had a fresh install on a MacOS and Linux hosts (relevant tech stack in the original post).
I didnt need to reinstall the tooling e.g.
npm i -g firebase-tools
. Downgrading the node version and removing the local cache did the trick for my situation.Using the following Dockerfile I am able to replicate the original error message:
Build the image
Run the container interactively with access to the host network
Then
At this point the following error message is shown:
Using NVM on a mac.
Works for me with node 20.11.1 but only through the terminal and running
firebase emulators:start
. I get the same problem when runningnpm run ...
, or using the Webstorm Run feature.can confirm that pub/sub breaks the emulator on Latest LTS Version: 18.16.0
I tried downgrading node version, Java version, etc. Not much seemed to work. Unzipped ui-v1.11.5.zip manually in
~/.cache/firebase
, and it’s working now. My env is now OpenJDK 11 and Node 18.15.0 .Got the same problem with node 18.16 (ui-emulator v1.11.5). Downgrading node to 18.15 and removing ~/.cache/firebase solved the issue.
Worked for me. Very annoying problem firebase team 😦
@CTxD you can also go for version @18 and works fine
I had an issue using the solutions above, due to multiple node versions installed with Homebrew.
I solved it with these steps: