firebase-tools: `firebase serve` fails with TypeError on Travis CI
Hey there! I’m trying to run firebase serve
on Travis CI to run smoke tests. App fails to start with Error: An unexpected error has occurred.
:
i functions: Preparing to emulate HTTPS functions. Support for other event types coming soon.
[2017-06-05T12:44:01.457Z] TypeError: Cannot read property 'refresh_token' of undefined
- I’m using
firebase serve --debug --only functions,hosting --token $FIREBASE_TOKEN --project $FIREBASE_PROJECT
to run it - I also have
sudo: required
in Travis config - Everything works fine with same setup locally
Versions:
firebase-tools@3.9.1
firebase-functions@0.5.7
firebase@4.1.0
Any ideas?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (10 by maintainers)
Commits related to this issue
- Fixes issue #364 — committed to remie/firebase-tools by remie 6 years ago
Hi. I get the same error when I tried to run serve functions in a docker image.
Looks like the problem is the empty configstore. The auth does not set the token from the cli parameters because this line never executed: https://github.com/firebase/firebase-tools/blob/master/lib/auth.js#L230 (the
currentRefreshToken === undefined
andrefreshToken
equal with the--token
parameter)So when
ensureDefaultCredentials
read thetokens
from the configstore it return withundefined
Having the same issue trying to use
firebase serve --only functions --debug
inside of a docker container for local development and testing, the initial HTTP calls for the token do respond with 200s.