Open wwmike opened 9 months ago
node:internal/modules/cjs/loader:986
throw new ERR_REQUIRE_ESM(filename, true);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/ryan/.cache/firebase/emulators/ui-v1.11.8/server/server.mjs not supported.
Instead change the require of /home/ryan/.cache/firebase/emulators/ui-v1.11.8/server/server.mjs to a dynamic import() which is available in all CommonJS modules.
at Function.runMain (pkg/prelude/bootstrap.js:1979:12) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v18.5.0
The same issue with a fresh install of Ubuntu 22.04.4 LTS. Tested Node 16, 18 and 20 LTS. @christhompsongoogle Is Firebase Emulator not compatible with Ubuntu 22.04?
I made some changes to the UI recently which changed the output from js to mjs - try installing a version prior to 13.5.1 and see if that fixes the issue
https://github.com/firebase/firebase-tools/releases/tag/v13.5.1
try installing a version prior to 13.5.1 and see if that fixes the issue
https://github.com/firebase/firebase-tools/releases/tag/v13.5.0 fixes the issue.
I have 13.6.0 and facing the same issue, should I downgrade?
Try downgrading and report the results, I can't reproduce on my linux version but more information is helpful
On Wed, Mar 27, 2024 at 2:09 PM Moses Gameli @.***> wrote:
I have 13.6.0 and facing the same issue, should I downgrade?
— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools-ui/issues/1014#issuecomment-2023995002, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZKGOHSY3YILS6HWXBXOBJLY2MYRZAVCNFSM6AAAAABCWHS7PCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRTHE4TKMBQGI . You are receiving this because you were mentioned.Message ID: <firebase/firebase-tools-ui/issues/1014/2023995002 <(202)%20399-5002>@ github.com>
Same here, downgrading to 13.5.0 solved the issue.
Downgrading from 13.8.0 to 13.5.0 resolved the issue for me as well.
running into this on macOS 14.6.1 as well:
firebase --version
13.16.0
and in ui-debug.log
:
node:internal/modules/cjs/loader:986
throw new ERR_REQUIRE_ESM(filename, true);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/amorton/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs not supported.
Instead change the require of /Users/amorton/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs to a dynamic import() which is available in all CommonJS modules.
at Function.runMain (pkg/prelude/bootstrap.js:1979:12) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v18.5.0
Something is clearly broken here - and downgrading isn't really a solution - can someone please look at this?
@christhompsongoogle
running into this on macOS 14.6.1 as well:
firebase --version 13.16.0
and in
ui-debug.log
:node:internal/modules/cjs/loader:986 throw new ERR_REQUIRE_ESM(filename, true); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/amorton/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs not supported. Instead change the require of /Users/amorton/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs to a dynamic import() which is available in all CommonJS modules. at Function.runMain (pkg/prelude/bootstrap.js:1979:12) { code: 'ERR_REQUIRE_ESM' } Node.js v18.5.0
Something is clearly broken here - and downgrading isn't really a solution - can someone please look at this?
@christhompsongoogle
I have the exact problem. Did you manage to fix it.
Something is clearly broken here - and downgrading isn't really a solution - can someone please look at this?
Same issue here, also on macOS 14.6.1.
firebase --version
13.17.0
Downgrading does work, but reports the following warnings:
npm install -g firebase-tools@13.5.0
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated google-p12-pem@3.1.4: Package is no longer maintained
npm warn deprecated google-p12-pem@4.0.1: Package is no longer maintained
npm warn deprecated google-p12-pem@4.0.1: Package is no longer maintained
added 106 packages, removed 82 packages, and changed 551 packages in 6s
67 packages are looking for funding
run `npm fund` for details
Additionally, this warning shows up in the function logs:
function[europe-west2-myFunction] (node:49542) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
function[europe-west2-myFunction] (Use `node --trace-deprecation ...` to show where the warning was created)
It would be great to see some movement on a proper fix as opposed to a risky workaround.
I am also having this issue on Ubuntu 24.04.1 LTS | firebase
13.18.0
At least on Mac, removing the broken curl-installed latest version (13.19.0) with curl -sL https://firebase.tools | uninstall=true bash
and replacing it with the npm version (npm install -g firebase-tools@latest
) works. ¯_(ツ)_/¯
@kwight thanks, it fixed my error
@kwight I didn't need to uninstall anything, but it appears that this issue is indeed fixed in 13.20.x 🥳
@Genyus , i try get my firebase emulator on Docker work as code show below
FROM openjdk:24-slim
RUN apt-get update && apt-get install -y curl sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN curl -sL https://firebase.tools | bash
The same error present
node:internal/modules/cjs/loader:986
throw new ERR_REQUIRE_ESM(filename, true);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /root/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs not supported.
Instead change the require of /root/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs to a dynamic import() which is available in all CommonJS modules.
at Function.runMain (pkg/prelude/bootstrap.js:1979:12) {
code: 'ERR_REQUIRE_ESM'
}
Config:
root@3c8f7ba2d348:/# firebase --version
13.20.2
root@3c8f7ba2d348:/# node -v
v20.17.0
@neviaumi Maybe try the approach suggested by @kwight above in your Docker config and install with npm instead of curl?
At least on Mac, removing the broken curl-installed latest version (13.19.0) with
curl -sL https://firebase.tools | uninstall=true bash
and replacing it with the npm version (npm install -g firebase-tools@latest
) works. ¯(ツ)/¯
@Genyus Thanks for suggestion :) I do fix it as you suggested. Using Npm instead of auto installation script.
Here is working docker file
FROM openjdk:24-slim
RUN apt-get update && apt-get install -y curl sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
RUN <<EOF
#!/bin/bash
source ~/.bashrc
nvm install --lts
nvm use --lts
npm install -g firebase-tools
EOF
RUN cat <<EOF > ./firebase.json
{
"emulators": {
"auth": {
"host": "0.0.0.0"
},
"firestore": {
"host":"0.0.0.0"
},
"ui": {
"host": "0.0.0.0"
}
}
}
EOF
RUN mkdir -p ./scripts/docker
RUN cat <<EOF > ./scripts/docker/start.sh
#!/bin/bash
source ~/.bashrc
cat ./firebase.json
nvm use --lts
firebase emulators:start --project made-in-uk
EOF
This is making firebase-asdf
unusable, unfortunately.
I'm having the same issue on the latest version, 13.22.1, on MacOS, installed using the installation script from firebase.tools
.
Installing via npm install -g firebase-tools
as suggested by kwight gave me the same version (13.22.1), but the way that npm installed it, it works fine!
I wonder if it's something to do with the node environment it runs in, because I also noticed in ui-debug.log that when it was having an error, the end of the log said "Node.js v18.5.0" which is not a version I can find installed on my system... (at least not via nvm or asdf... I don't think MacOS has a system version of node preinstalled, does it?)
Occurring for me on MacOS as well. Installing npm install -g firebase-tools
did not fix the issue.
Only thing that worked,
npm i firebase-tools@latest -g
In our case, we were not able to install firebase-tools using npm. The script version was getting installed, but it has some known bug with latest release.
why is my app crashing in the emulator
Describe the bug When I start the emulators with emulators start command, all, but ui starts. This is the error log:
I don't know where node v18.5.0 comes from, I haven't found this version on my PC, my node version is 21.1.0, which is available in $PATH. Also, once I could see v20 after
nvm use v20...
and deleting firebase cache, but the next run it was v18.5.0 again.To Reproduce Steps to reproduce the behavior:
firebase emulators:start
Expected behavior It should be running.
Desktop:
Additional context Add any other context about the problem here.