firebase / firebase/firebase-tools-ui
firebase emulators:start Fails with ESM Import Error in Emulator UI on MacOS
- Dominant language
- TypeScript
- Stars
- 291
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
Running `firebase emulators:start --debug` causes a fatal error in the Emulator UI, exiting with code `1`. This error appears to be related to the module type for `server.mjs`, which requires ESM support but is being handled by CommonJS’s `require()`.
### To Reproduce
1. Run `firebase init` and select only **auth** to emulate.
2. Enable the Emulator **UI** during setup.
3. Execute `firebase emulators:start`.
My firebase.json
```
{
"emulators": {
"auth": {
"port": 9099
},
"ui": {
"enabled": true
},
"singleProjectMode": true
}
}
```
### Expected behavior
The emulators should start successfully, with the Emulator UI accessible and logging as expected.
### Screenshots
_No screenshots were provided._
### Desktop (please complete the following information):
- **OS**: MacOS 15.0.1 (24A348)
- **Browser**: (e.g., Chrome, Safari)
- **Version**: _(e.g., Chrome 22)_
### Additional context
- **Node version**: v20.14.0
- The error suggests using `import()` in place of `require()` for `/server/server.mjs`, aligning with Node's ESM requirements.
- Emulator UI version: v1.14.0
Contributor guide
Assessment
This issue has not been assessed yet.