firebase / firebase/firebase-tools

Functions Emulator error when using SEA preview build

Open
#10,984 3 comments 0 reactions 1 assignee Claimed by @joehan View on GitHub
emulators: functions firepit type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 15.26.0 (SEA preview build)

**Platform:** macOS

### [REQUIRED] Test case

### [REQUIRED] Steps to reproduce

1. Run `firebase init functions --project demo-project`
```
✔ What language would you like to use to write Cloud Functions? JavaScript
✔ Do you want to use ESLint to catch probable bugs and enforce style? No
✔ Wrote functions/package.json
✔ Wrote functions/index.js
✔ Wrote functions/.gitignore
✔ Do you want to install dependencies with npm now? Yes
```
2. Update `functions/index.js`
```js
const { onRequest } = require("firebase-functions/https");
const logger = require("firebase-functions/logger");

exports.helloWorld = onRequest((request, response) => {
logger.info("Hello logs!", { structuredData: true });
response.send("Hello from Firebase!");
});
```
3. Run `firebase emulators:start --project demo-project`
4. Open `http://127.0.0.1:5001/demo-project/us-central1/helloWorld` on a browser
- This gets stuck

### [REQUIRED] Expected behavior

There shouldn't be any errors when invoking functions on the Functions Emulator

### [REQUIRED] Actual behavior

Functions Emulator shows these errors
```
> Error: /Users/USER/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime is not a Firebase command
⬢ functions: Failed to handle request for function us-central1-helloWorld
⬢ functions: Failed to start functions in /Users/USER/Desktop/firebase-tools/node-sea-test/func-emulator/functions: Failed to load function.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.