The issue only occurs when the Emulator has not been downloaded yet.
$ npx firebase emulators:start --only firestore
i emulators: Starting emulators: firestore
⚠ It appears you are running in a CI environment. You can avoid downloading the Firestore Emulator repeatedly by caching the /home/circleci/.cache/firebase/emulators directory.
i firestore: downloading cloud-firestore-emulator-v1.11.9.jar...
i emulators: Shutting down emulators.
i firestore: Stopping Firestore Emulator
i hub: Stopping emulator hub
Error: An unexpected error has occurred.
npx firebase emulators:start --only firestore --debug
[2020-11-13T16:42:29.120Z] > 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"]
[2020-11-13T16:42:29.121Z] > authorizing via FIREBASE_TOKEN environment variable
i emulators: Starting emulators: firestore {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: firestore"}}
[2020-11-13T16:42:29.173Z] [hub] writing locator at /tmp/hub-icebreaker-devel.json
⚠ It appears you are running in a CI environment. You can avoid downloading the Firestore Emulator repeatedly by caching the /home/circleci/.cache/firebase/emulators directory.
i firestore: downloading cloud-firestore-emulator-v1.11.9.jar... {"metadata":{"emulator":{"name":"firestore"},"message":"downloading cloud-firestore-emulator-v1.11.9.jar..."}}
i emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
i firestore: Stopping Firestore Emulator {"metadata":{"emulator":{"name":"firestore"},"message":"Stopping Firestore Emulator"}}
i hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
[2020-11-13T16:42:29.186Z] ReferenceError: URL is not defined
at /home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:69:19
at Generator.next (<anonymous>)
at /home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:8:71
at new Promise (<anonymous>)
at __awaiter (/home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:4:12)
at downloadToTmp (/home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:68:12)
at /home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:27:27
at Generator.next (<anonymous>)
at /home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:8:71
at new Promise (<anonymous>)
at __awaiter (/home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:4:12)
at module.exports (/home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/download.js:23:28)
at Object.<anonymous> (/home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/downloadableEmulators.js:304:23)
at Generator.next (<anonymous>)
at /home/circleci/icebreaker/functions/node_modules/firebase-tools/lib/emulator/downloadableEmulators.js:8:71
at new Promise (<anonymous>)
Error: An unexpected error has occurred.
@bkendall this is one of my least favorite kind of bugs, where TS made us less safe because the Node typings it provides can only represent a single Node version.
firebase-tools: 8.16.0 & 8.16.1
Platform: CircleCI
circleci/node:8.14.0-stretch-browsers
Test case
The issue only occurs when the Emulator has not been downloaded yet.
Steps to reproduce
Expected behavior
The Emulator downloads and runs successfully.
Actual behavior
cc @nickpell
The text was updated successfully, but these errors were encountered: