question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

firebase-tools serve makes an error

See original GitHub issue

[REQUIRED] Environment info

**firebase-tools: 7.8.0 (the latest)

**Platform: macOS

[REQUIRED] Test case

firebase functions

project

functions index.js : exports.posts = functions.https.onRequest(require(‘./posts’)); exports.posts = functions.https.onRequest(require(‘./accounts’));

posts : index.js : const app = require(‘express’)(); const cors = require(‘cors’); app.use(cors({ origin: true })); app.get(‘/’, async (req, res) => { }); accounts: index.js : const app = require(‘express’)(); const cors = require(‘cors’); app.use(cors({ origin: true })); app.get(‘/’, async (req, res) => { });

[REQUIRED] Steps to reproduce

firebase functions + express get / post methods request multiple get requests, it makes errors. it is only made on firebase-tools 7.8.0. if I run the same codes on firebase-tools 7.7.0., it works fine.

[REQUIRED] Expected behavior

If I request multiple requests, it accepts well and perform.

[REQUIRED] Actual behavior

it makes an error

i  functions: Beginning execution of "accounts"
[2019-11-19T10:17:42.957Z] [runtime-status]  {"httpsTrigger":{},"name":"accounts","entryPoint":"accounts"}
[2019-11-19T10:17:42.957Z] [runtime-status] Running accounts in mode HTTPS {}
[2019-11-19T10:17:42.962Z] [functions] Runtime ready! Sending request!
[2019-11-19T10:17:42.968Z] [runtime-status] Ephemeral server used! {}
[2019-11-19T10:17:43.003Z] [runtime-status] Ephemeral server survived. {}
[2019-11-19T10:17:43.339Z] Accepted request OPTIONS /~/posts/rT7UgEMG8KhTlLOADE3y/comments --> posts
[2019-11-19T10:17:43.339Z] [worker-posts-3a43686e-d66c-4835-a45e-b4be49366232]: Assigning socketPath: /var/folders/zp/903b9f055r1czvjktw3fg_7r0000gn/T/firebase_emulator_invocation_3a43686e-d66c-4835-a45e-b4be49366232.sock
[2019-11-19T10:17:43.339Z] [worker-posts-3a43686e-d66c-4835-a45e-b4be49366232]: BUSY
[2019-11-19T10:17:43.339Z] [runtime-status] Trigger "posts" has been found, beginning invocation! {}
i  functions: Beginning execution of "posts"
[2019-11-19T10:17:43.340Z] [runtime-status]  {"httpsTrigger":{},"name":"posts","entryPoint":"posts"}
[2019-11-19T10:17:43.340Z] [runtime-status] Running posts in mode HTTPS {}
>  events.js:174
>        throw er; // Unhandled 'error' event
>        ^
>  
>  Error: listen EADDRINUSE: address already in use /var/folders/zp/903b9f055r1czvjktw3fg_7r0000gn/T/firebase_emulator_invocation_3a43686e-d66c-4835-a45e-b4be49366232.sock
>      at Server.setupListenHandle [as _listen2] (net.js:1263:19)
>      at listenInCluster (net.js:1328:12)
>      at Server.listen (net.js:1426:5)
>      at Function.listen (/Users/mmj/.npm-global/lib/node_modules/firebase-tools/node_modules/express/lib/application.js:618:24)
>      at Promise (/Users/mmj/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:563:46)
>      at new Promise (<anonymous>)
>      at /Users/mmj/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:528:15
>      at Generator.next (<anonymous>)
>      at /Users/mmj/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:7:71
>      at new Promise (<anonymous>)
>  Emitted 'error' event at:
>      at emitErrorNT (net.js:1307:8)
>      at process._tickCallback (internal/process/next_tick.js:63:19)
[2019-11-19T10:17:43.352Z] [worker-posts-3a43686e-d66c-4835-a45e-b4be49366232]: exited
[2019-11-19T10:17:43.353Z] [worker-posts-3a43686e-d66c-4835-a45e-b4be49366232]: FINISHED

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
samtsterncommented, Nov 20, 2019

For everyone affected by this: version 7.8.1 was just released!

0reactions
parshercommented, Nov 21, 2019

@samtstern Thank you for your fast release! @richard-mckenna Me too, I eased every code I had written when I face it. ha ha. I am using Vue too 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase CLI reference
Emulator Suite · Authentication · Realtime Database · Firestore · Storage · ML · Hosting · Cloud Functions.
Read more >
"An unexpected error has occurred" after firebase deploy
For me updating firebase-tools solved the issue. run below command in your cmd prompt npm install -g firebase-tools. then try firebase init again....
Read more >
Firebase CLI
The Firebase Command Line Interface (CLI) Tools can be used to test, manage, and deploy your Firebase project from the command line.
Read more >
Firebase serve error | Sololearn: Learn to code for FREE!
functions: The Cloud Firestore emulator is not running, so calls to Firestore will affect production. ! functions: Cannot find module './tsconfig.json' Require ...
Read more >
Walkthrough - Full-Stack Firebase
Run firebase deploy to deploy your new project. ... Error: HTTP Error: 400, Project 'how-to-firebase-tutorials' is not a Firestore enabled project. ... in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found