Be able to run the firebase emulator in IDX
I love that i can connect to a production firebase environment, but can you make it so i can run my emulators from within IDX? i managed with the firebase-tools to setup everything but i just get an error when doing
firebase emulators:start
i emulators: Starting emulators: auth, functions, firestore
⚠ firestore: Error when trying to check port 8080 on ::1: Error: listen EADDRNOTAVAIL: address not available ::1:8080
⚠ firestore: Port 8080 is not open on localhost (127.0.0.1,::1), could not start Firestore Emulator.
⚠ firestore: To select a different host/port, specify that host/port in a firebase.json config file:
{
// ...
"emulators": {
"firestore": {
"host": "HOST",
"port": "PORT"
}
}
}
⚠ hub: Error when trying to check port 4400 on ::1: Error: listen EADDRNOTAVAIL: address not available ::1:4400
⚠ hub: Port 4400 is available on 127.0.0.1 but not ::1. This may cause issues with some clients.
⚠ hub: If you encounter connectivity issues, consider switching to a different port or explicitly specifying "host": "<ip address>" instead of hostname in firebase.json
⚠ ui: Error when trying to check port 4000 on ::1: Error: listen EADDRNOTAVAIL: address not available ::1:4000
⚠ ui: Port 4000 is available on 127.0.0.1 but not ::1. This may cause issues with some clients.
⚠ ui: If you encounter connectivity issues, consider switching to a different port or explicitly specifying "host": "<ip address>" instead of hostname in firebase.json
⚠ logging: Error when trying to check port 4500 on ::1: Error: listen EADDRNOTAVAIL: address not available ::1:4500
⚠ logging: Port 4500 is available on 127.0.0.1 but not ::1. This may cause issues with some clients.
⚠ logging: If you encounter connectivity issues, consider switching to a different port or explicitly specifying "host": "<ip address>" instead of hostname in firebase.json
⚠ auth: Error when trying to check port 9099 on ::1: Error: listen EADDRNOTAVAIL: address not available ::1:9099
⚠ auth: Port 9099 is available on 127.0.0.1 but not ::1. This may cause issues with some clients.
⚠ auth: If you encounter connectivity issues, consider switching to a different port or explicitly specifying "host": "<ip address>" instead of hostname in firebase.json
⚠ firestore.websocket: Error when trying to check port 9150 on ::1: Error: listen EADDRNOTAVAIL: address not available ::1:9150
⚠ firestore: Port 9150 is available on 127.0.0.1 but not ::1. This may cause issues with some clients.
⚠ firestore: If you encounter connectivity issues, consider switching to a different port or explicitly specifying "host": "<ip address>" instead of hostname in firebase.json
i emulators: Shutting down emulators.
-
Harold Kim commented
@Marny did you install java from the terminal? (if so, how?) i am trying to use the emulators but it says java is not installed
-
Marny López (iMrLopez) commented
I was actually able to run the emulators like this:
in `firebase.json` change the emulators to use ports that are not used by IDX
```
"auth": {
"port": 7777
},
"functions": {
"port": 7776
},
"firestore": {
"port": 7775
},
"ui": {
"enabled": true,
"port": 7774
},
```and then export the ports 1 by 1 in your terminal:
```
export port=7777
export port=7776
export port=7775
export port=7774```
and then run `firebase emulators:start` and it should start the emulators