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

firebase emulators:start not working #7511

Closed
pastorius187 opened this issue Jul 30, 2024 · 1 comment
Closed

firebase emulators:start not working #7511

pastorius187 opened this issue Jul 30, 2024 · 1 comment

Comments

@pastorius187
Copy link

[REQUIRED] Environment info

13.14.2

firebase-tools-instant-win.exe

firebase-tools:

Platform:
Windows 11

[REQUIRED] Test case

!-- Provide a minimal, complete, and verifiable example (http://stackoverflow.com/help/mcve) -->
I want to run the emulator.

[REQUIRED] Steps to reproduce

Everything works perfectly until I enter

firebase emulators:start

I get

firebase emulators:start
i emulators: Starting emulators: database
i database: Database Emulator logging to database-debug.log
i ui: Emulator UI logging to ui-debug.log
! ui: Fatal error occurred:
Emulator UI has exited with code: 1,
stopping all running emulators
i ui: Stopping Emulator UI
i database: Stopping Database Emulator
! Database Emulator has exited upon receiving signal: SIGINT
i hub: Stopping emulator hub
i logging: Stopping Logging Emulator

Having trouble? Try firebase [command] --help

[REQUIRED] Expected behavior

Start emulator

[REQUIRED] Actual behavior

firebase emulators:start --debug
[2024-07-30T21:13:31.374Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2024-07-30T21:13:31.375Z] > authorizing via signed-in user (vasek.jezek@gmail.com)
[2024-07-30T21:13:31.477Z] java version "21.0.1" 2023-10-17 LTS

[2024-07-30T21:13:31.477Z] Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)

[2024-07-30T21:13:31.490Z] Parsed Java major version: 21
i emulators: Starting emulators: database {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: database"}}
[2024-07-30T21:13:31.500Z] [logging] Logging Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2024-07-30T21:13:31.500Z] [database] Database Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2024-07-30T21:13:31.501Z] assigned listening specs for emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"ui":[{"address":"127.0.0.1","family":"IPv4","port":4000},{"address":"::1","family":"IPv6","port":4000}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}],"database":[{"address":"127.0.0.1","family":"IPv4","port":9000}]},"metadata":{"message":"assigned listening specs for emulators"}}
[2024-07-30T21:13:31.507Z] [hub] writing locator at C:\Users\vasek\AppData\Local\Temp\hub-ginzel-f75a8.json
[2024-07-30T21:13:31.514Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/ginzel-f75a8 [none]
[2024-07-30T21:13:31.771Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/ginzel-f75a8 200
[2024-07-30T21:13:31.772Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/ginzel-f75a8 {"projectId":"ginzel-f75a8","projectNumber":"1000465334684","displayName":"Ginzel","name":"projects/ginzel-f75a8","resources":{"hostingSite":"ginzel-f75a8","realtimeDatabaseInstance":"ginzel-f75a8-default-rtdb","storageBucket":"ginzel-f75a8.appspot.com","locationId":"europe-central2"},"state":"ACTIVE","etag":"1_11f36aa5-5297-48bc-a0f1-a54e41cb6ae5"}
[2024-07-30T21:13:31.772Z] database rules config: [{"instance":"ginzel-f75a8-default-rtdb","rules":"C:\Users\vasek\Documents\firebase\database.rules.json"}]
[2024-07-30T21:13:31.777Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: projectId"}}
[2024-07-30T21:13:31.778Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: auto_download"}}
[2024-07-30T21:13:31.778Z] Ignoring unsupported arg: rules {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: rules"}}
[2024-07-30T21:13:31.778Z] Starting Database Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","C:\Users\vasek\.cache\firebase\emulators\firebase-database-emulator-v4.11.2.jar","--host","127.0.0.1","--port",9000,"--single_project_mode","Warning"],"optionalArgs":["port","host","functions_emulator_port","functions_emulator_host","single_project_mode"],"joinArgs":false,"shell":false} {"metadata":{"emulator":{"name":"database"},"message":"Starting Database Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","C:\\Users\\vasek\\.cache\\firebase\\emulators\\firebase-database-emulator-v4.11.2.jar","--host","127.0.0.1","--port",9000,"--single_project_mode","Warning"],"optionalArgs":["port","host","functions_emulator_port","functions_emulator_host","single_project_mode"],"joinArgs":false,"shell":false}"}}
i database: Database Emulator logging to database-debug.log {"metadata":{"emulator":{"name":"database"},"message":"Database Emulator logging to \u001b[1mdatabase-debug.log\u001b[22m"}}
[2024-07-30T21:13:33.404Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[2024-07-30T21:13:33.404Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[2024-07-30T21:13:33.405Z] Starting Emulator UI with command {"binary":"node","args":["C:\Users\vasek\.cache\firebase\emulators\ui-v1.13.0\server\server.mjs"],"optionalArgs":[],"joinArgs":false,"shell":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {"binary":"node","args":["C:\\Users\\vasek\\.cache\\firebase\\emulators\\ui-v1.13.0\\server\\server.mjs"],"optionalArgs":[],"joinArgs":false,"shell":false}"}}
i ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[2024-07-30T21:13:33.546Z] node:internal/modules/cjs/loader:986
throw new ERR_REQUIRE_ESM(filename, true);
^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\vasek.cache\firebase\emulators\ui-v1.13.0\server\server.mjs not supported.
Instead change the require of C:\Users\vasek.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
{"metadata":{"emulator":{"name":"ui"},"message":"node:internal/modules/cjs/loader:986\r\n throw new ERR_REQUIRE_ESM(filename, true);\r\n ^\r\n\r\nError [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\vasek\.cache\firebase\emulators\ui-v1.13.0\server\server.mjs not supported.\r\nInstead change the require of C:\Users\vasek\.cache\firebase\emulators\ui-v1.13.0\server\server.mjs to a dynamic import() which is available in all CommonJS modules.\r\n at Function.runMain (pkg/prelude/bootstrap.js:1979:12) {\r\n code: 'ERR_REQUIRE_ESM'\r\n}\r\n\r\nNode.js v18.5.0\r\n"}}
! ui: Fatal error occurred:
Emulator UI has exited with code: 1,
stopping all running emulators {"metadata":{"emulator":{"name":"ui"},"message":"Fatal error occurred: \n Emulator UI has exited with code: 1, \n stopping all running emulators"}}
i ui: Stopping Emulator UI {"metadata":{"emulator":{"name":"ui"},"message":"Stopping Emulator UI"}}
i database: Stopping Database Emulator {"metadata":{"emulator":{"name":"database"},"message":"Stopping Database Emulator"}}
! Database Emulator has exited upon receiving signal: SIGINT
i hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
i logging: Stopping Logging Emulator {"metadata":{"emulator":{"name":"logging"},"message":"Stopping Logging Emulator"}}

Having trouble? Try firebase [command] --help

ui-debug.log

node:internal/modules/cjs/loader:986
throw new ERR_REQUIRE_ESM(filename, true);
^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\vasek.cache\firebase\emulators\ui-v1.13.0\server\server.mjs not supported.
Instead change the require of C:\Users\vasek.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

@aalej
Copy link
Contributor

aalej commented Jul 31, 2024

Hey @pastorius187, thanks for sharing debug logs. From what I can tell, you’re encountering a similar issue to #6931. A detailed explanation of why this is occurring can be found in #6931 (comment). Currently, to workaround the issue, you could either try installing firebase-tools through npm i firebase-tools -g or disabling the Emulator UI:

{
  ...
  "emulators": {
    "firestore": {
      "port": 8080
    },
    "hosting": {
      "port": 5000
    },
    "ui": {
      "enabled": false // Disables the emulator UI
    },
    "singleProjectMode": true
  }
  ...
}

I’ll be closing this as a duplicate, please refer to the other ticket for any updates. If you think this is a mistake, feel free to ask this issue to be reopened.

@aalej aalej closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants