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.

checkFirebaseSDKVersion errors on hosting deploy

See original GitHub issue

Hi, I am not sure what’s going on but after upgrading Angular 9->10 I am getting errors deploying to Firebase Hosting.

I filed an issue over at the Angular repo but got the sense that it could be an issue with Firebase-tools. I’ve upgraded to latest Firebase-tools but still getting errors when trying to deploy.

Hoping someone can give me a pointer to what’s wrong. I am having this issues on multiple different projects.

Firebase-debug.log doesn’t provide much helpful information.

.firebaserc:

{
  "projects": {
    "default": "fabrik-menu-poc",
    "test": "fabrik-menu-poc"
  }
}

Running firebase deploy --project test gives me

firebase deploy --only hosting --project test


Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! fabrik-menu-poc@0.0.0 deploy:test: `firebase deploy --only hosting --project test`
npm ERR! Exit status 2

Error log:

silly lifecycle fabrik-menu-poc@0.0.0~deploy:test: Args: [ '-c', 'firebase deploy --only hosting --project test' ]
11 silly lifecycle fabrik-menu-poc@0.0.0~deploy:test: Returned: code: 2  signal: null
12 info lifecycle fabrik-menu-poc@0.0.0~deploy:test: Failed to exec deploy:test script
13 verbose stack Error: fabrik-menu-poc@0.0.0 deploy:test: `firebase deploy --only hosting --project test`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/Users/lrj/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (/Users/lrj/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid fabrik-menu-poc@0.0.0
15 verbose cwd /Users/lrj/project/mother-qorder/admin
16 verbose Darwin 19.5.0
17 verbose argv "/Users/lrj/.nvm/versions/node/v12.13.1/bin/node" "/Users/lrj/.nvm/versions/node/v12.13.1/bin/npm" "run" "deploy:test"
18 verbose node v12.13.1
19 verbose npm  v6.12.1
20 error code ELIFECYCLE
21 error errno 2
22 error fabrik-menu-poc@0.0.0 deploy:test: `firebase deploy --only hosting --project test`
22 error Exit status 2
23 error Failed at the fabrik-menu-poc@0.0.0 deploy:test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

[error] Error: An unexpected error has occurred.
[debug] [2020-06-28T12:47:49.194Z] ----------------------------------------------------------------------
[debug] [2020-06-28T12:47:49.196Z] Command:       /Users/lrj/.nvm/versions/node/v12.13.1/bin/node /Users/lrj/project/mother-qorder/admin/node_modules/.bin/firebase deploy --only hosting --project test
[debug] [2020-06-28T12:47:49.196Z] CLI Version:   8.4.3
[debug] [2020-06-28T12:47:49.196Z] Platform:      darwin
[debug] [2020-06-28T12:47:49.196Z] Node Version:  v12.13.1
[debug] [2020-06-28T12:47:49.197Z] Time:          Sun Jun 28 2020 14:47:49 GMT+0200 (Central European Summer Time)
[debug] [2020-06-28T12:47:49.197Z] ----------------------------------------------------------------------
[debug] [2020-06-28T12:47:49.197Z] 
[debug] [2020-06-28T12:47:49.207Z] > 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"]
[debug] [2020-06-28T12:47:49.207Z] > authorizing via signed-in user
[debug] [2020-06-28T12:47:49.207Z] [iam] checking project fabrik-menu-poc for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[debug] [2020-06-28T12:47:49.210Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/fabrik-menu-poc:testIamPermissions  
 {"permissions":["firebase.projects.get","firebasehosting.sites.update"]}
[debug] [2020-06-28T12:47:50.114Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sun, 28 Jun 2020 12:47:49 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=730","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-06-28T12:47:50.116Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/fabrik-menu-poc  
 
[debug] [2020-06-28T12:47:51.237Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sun, 28 Jun 2020 12:47:51 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-06-28T12:47:51.387Z] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:112:11)
    at Object.join (path.js:1040:7)
    at Object.checkFunctionsSDKVersion [as fn] (/Users/lrj/project/mother-qorder/admin/node_modules/firebase-tools/lib/checkFirebaseSDKVersion.js:33:28)
    at Command.<anonymous> (/Users/lrj/project/mother-qorder/admin/node_modules/firebase-tools/lib/command.js:159:30)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/lrj/project/mother-qorder/admin/node_modules/firebase-tools/lib/command.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
[error] 
[error] Error: An unexpected error has occurred.

Firebase-tools version:

firebase-tools": "^8.4.3"

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
laurenzlongcommented, Jun 29, 2020

@samtstern checkFirebaseSDKVersion runs for all deploys (since the intention is that there may be other SDKs for other products that we’d want to check the version of, although right now it’s just for functions.) I think the fix is that it should also be checking the --only flag to not check functions SDK if it’s functions are being deployed. I don’t think I’ll have time to address this soon, but would definitely be happy to review PRs.

The workaround, as you’ve both discovered, is to remove “functions” from firebase.json if functions code has been removed from the project directory.

1reaction
samtsterncommented, Jun 29, 2020

@spock123 yep that’s it! What’s happening is that adding functions to firebase.json implies that you’re using Cloud Functions. We have a check (checkFirebaseSDKVersion.js) which tries to make sure your functions code is deployable but you don’t have any functions code so it errored when trying to read the default path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase deploy error on public key / directory - Stack Overflow
I have an error when I try to deploy "Error: Specified public directory does not exist, can't deploy hosting" I have been following...
Read more >
Fix error ERR_INVALID_ARG_TYPE deploying to Firebase ...
The first thing we can try is to deploy just our website to Firebase hosting instead of trying to deploy the whole project....
Read more >
An unexpected error has occurred.” while deploying firebase ...
I am trying to deploy a firebase function for my Android application. I referred the Google's official documentation for the deployment of ...
Read more >
Report errors | Cloud Functions for Firebase - Google
Automatically reporting errors. You can emit an error from a Cloud Function to Error Reporting as shown below: Node.js ...
Read more >
Facing Deploy Error - Render community
Hi, Whenever I deploy render prompts the following Is the System down? My webhooks are also failing.
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