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 10.9.x deploy failed

See original GitHub issue

Environment

Nuxt v3.0.0-rc.3 Node Version: v16.15.0 Firebase Tools 10.9.2(or 10.9.0 -) Windows 11 wsl or Docker image andreysenov/firebase-tools@latest

Reproduction

npx nuxi init nuxt-app && Nitro Firebase

Describe the bug

Firebase tools version 10.9.x firebase deploy or firebase emulators:start failed. Successful deployment with version 10.7.0,10.8.0

Additional context

No response

Logs

$ firebase emulators:start
i  emulators: Starting emulators: functions, hosting
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, firestore, database, pubsub, storage
✔  functions: Using node@16 from host.
i  hosting[<your_project_id>]: Serving hosting files from: .output/public
✔  hosting[<your_project_id>]: Local server: http://127.0.0.1:5000
⚠  ui: Emulator UI unable to start on port 4000, starting on 4009 instead.
i  ui: downloading ui-v1.7.0.zip...
Progress: ============================================================================================> (100% of 5MB
i  ui: Removing outdated emulator files: ui-v1.6.6
i  ui: Removing outdated emulator files: ui-v1.6.6.zip
i  ui: Emulator UI logging to ui-debug.log
i  functions: Watching "/home/.../nuxt-app/.output/server" for Cloud Functions...

Error: An unexpected error has occurred.

debug.log

$ firebase emulators:start --debug
[2022-05-12T18:59:16.641Z] > 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"]
[2022-05-12T18:59:16.642Z] > authorizing via FIREBASE_TOKEN environment variable
i  emulators: Starting emulators: functions, hosting {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: functions, hosting"}}
⚠  emulators: It seems that you are running multiple instances of the emulator suite for project project_xxx. This may result in unexpected behavior.
[2022-05-12T18:59:16.666Z] [hub] writing locator at /tmp/hub-project_xxx.json
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, firestore, database, pubsub, storage {"metadata":{"emulator":{"name":"functions"},"message":"The following emulators are not running, calls to these services from the Functions emulator will affect production: \u001b[1mauth, firestore, database, pubsub, storage\u001b[22m"}}
✔  functions: Using node@16 from host. {"metadata":{"emulator":{"name":"functions"},"message":"Using node@16 from host."}}
[2022-05-12T18:59:16.683Z] defaultcredentials: writing to file /home/xxx/.config/firebase/xxx_application_default_credentials.json
[2022-05-12T18:59:16.685Z] Setting GAC to /home/xxx/.config/firebase/xxx_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /home/xxx/.config/firebase/xxx_application_default_credentials.json"}}
[2022-05-12T18:59:16.686Z] > refreshing access token with scopes: []
[2022-05-12T18:59:16.687Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
 <request body omitted>
[2022-05-12T18:59:16.840Z] <<< HTTP RESPONSE 200 {"pragma":"no-cache","date":"Thu, 12 May 2022 18:59:16 GMT","expires":"Mon, 01 Jan 1990 00:00:00 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":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"}
[2022-05-12T18:59:16.842Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/project_xxx/adminSdkConfig [none]
[2022-05-12T18:59:17.193Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/project_xxx/adminSdkConfig 200
[2022-05-12T18:59:17.193Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/project_xxx/adminSdkConfig {"projectId":"project_xxx","databaseURL":"https://project_xxx.firebaseio.com","storageBucket":"project_xxx.appspot.com","locationId":"us-central"}
[2022-05-12T18:59:17.204Z] >>> [apiv2][query] GET https://firebasehosting.googleapis.com/v1beta1/projects/project_xxx/sites
[2022-05-12T18:59:18.161Z] <<< [apiv2][status] GET https://firebasehosting.googleapis.com/v1beta1/projects/project_xxx/sites 200
[2022-05-12T18:59:18.161Z] <<< [apiv2][body] GET https://firebasehosting.googleapis.com/v1beta1/projects/project_xxx/sites {"sites":[{"name":"projects/project_xxx/sites/qi-tgh","defaultUrl":"https://qi-tgh.web.app","type":"USER_SITE"},{"name":"projects/project_xxx/sites/project_xxx","defaultUrl":"https://project_xxx.web.app","type":"DEFAULT_SITE"}]}
[2022-05-12T18:59:18.161Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/project_xxx/webApps/-/config [none]
[2022-05-12T18:59:18.828Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/project_xxx/webApps/-/config 200
[2022-05-12T18:59:18.828Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/project_xxx/webApps/-/config {"projectId":"project_xxx","databaseURL":"https://project_xxx.firebaseio.com","storageBucket":"project_xxx.appspot.com","locationId":"us-central","apiKey":"AIzaSyD_T9QgtiBkvGOaZIt1QkQ-uMGyWZI4XgU","authDomain":"project_xxx.firebaseapp.com","messagingSenderId":"527297563412"}
i  hosting[<your_project_id>]: Serving hosting files from: .output/public {"metadata":{"emulator":{"name":"hosting"},"message":"Serving hosting files from: \u001b[1m.output/public\u001b[22m"}}
✔  hosting[<your_project_id>]: Local server: http://127.0.0.1:5000 {"metadata":{"emulator":{"name":"hosting"},"message":"Local server: \u001b[4m\u001b[1mhttp://127.0.0.1:5000\u001b[22m\u001b[24m"}}
⚠  ui: Emulator UI unable to start on port 4000, starting on 4010 instead. {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI unable to start on port 4000, starting on 4010 instead."}}
[2022-05-12T18:59:18.853Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[2022-05-12T18:59:18.854Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[2022-05-12T18:59:18.854Z] Starting Emulator UI with command {"binary":"node","args":["/home/xxx/.cache/firebase/emulators/ui-v1.7.0/server.bundle.js"],"optionalArgs":[],"joinArgs":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {\"binary\":\"node\",\"args\":[\"/home/xxx/.cache/firebase/emulators/ui-v1.7.0/server.bundle.js\"],\"optionalArgs\":[],\"joinArgs\":false}"}}
i  ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[2022-05-12T18:59:18.938Z] Web / API server started at 127.0.0.1:4010
 {"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at 127.0.0.1:4010\n"}}
i  functions: Watching "/home/xxx/IdeaProjects/nuxt-app/.output/server" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"/home/xxx/IdeaProjects/nuxt-app/.output/server\" for Cloud Functions..."}}
[2022-05-12T18:59:19.121Z] Validating nodejs source
[2022-05-12T18:59:19.974Z] > [functions] package.json contents: {
  "private": true,
  "type": "module",
  "main": "./index.mjs",
  "dependencies": {
    "firebase-functions-test": "latest",
    "firebase-admin": "10.2.0",
    "firebase-functions": "3.21.1",
    "abort-controller": "3.0.0",
    "agent-base": "6.0.2",
    "arrify": "2.0.1",
    "async-retry": "1.3.3",
    "base64-js": "1.5.1",
    "bignumber.js": "9.0.2",
    "buffer-from": "1.1.2",
    "buffer-equal-constant-time": "1.0.1",
    "compressible": "2.0.18",
    "configstore": "5.0.1",
    "cookie-es": "0.5.0",
    "cors": "2.8.5",
    "crypto-random-string": "2.0.0",
    "date-and-time": "2.3.1",
    "debug": "4.3.4",
    "destr": "1.1.1",
    "dicer": "0.3.1",
    "dot-prop": "5.3.0",
    "duplexify": "4.1.2",
    "ecdsa-sig-formatter": "1.0.11",
    "end-of-stream": "1.4.4",
    "ent": "2.2.0",
    "event-target-shim": "5.0.1",
    "extend": "3.0.2",
    "fast-deep-equal": "3.1.3",
    "fast-text-encoding": "1.0.3",
    "functional-red-black-tree": "1.0.1",
    "gaxios": "4.3.3",
    "gcp-metadata": "4.3.1",
    "get-stream": "6.0.1",
    "google-auth-library": "7.14.1",
    "google-gax": "2.30.4",
    "google-p12-pem": "3.1.4",
    "graceful-fs": "4.2.10",
    "gtoken": "5.3.2",
    "h3": "0.7.8",
    "has-flag": "4.0.0",
    "hookable": "5.1.1",
    "hash-stream-validation": "0.2.4",
    "http-proxy-agent": "5.0.0",
    "https-proxy-agent": "5.0.1",
    "imurmurhash": "0.1.4",
    "inherits": "2.0.4",
    "is-obj": "2.0.0",
    "is-stream": "2.0.1",
    "is-stream-ended": "0.1.4",
    "jose": "2.0.5",
    "is-typedarray": "1.0.0",
    "json-bigint": "1.0.0",
    "jsonwebtoken": "8.5.1",
    "jwa": "2.0.0",
    "jwks-rsa": "2.1.2",
    "jws": "4.0.0",
    "limiter": "1.1.5",
    "lodash": "4.17.21",
    "lodash.camelcase": "4.3.0",
    "lodash.clonedeep": "4.5.0",
    "lodash.includes": "4.3.0",
    "lodash.isboolean": "3.0.3",
    "lodash.isinteger": "4.0.4",
    "lodash.isnumber": "3.0.3",
    "lodash.isplainobject": "4.0.6",
    "lodash.isstring": "4.0.1",
    "lodash.once": "4.1.1",
    "long": "4.0.0",
    "lru-cache": "4.0.2",
    "lru-memoizer": "2.1.4",
    "make-dir": "3.1.0",
    "mime": "3.0.0",
    "mime-db": "1.52.0",
    "mime-types": "2.1.35",
    "ms": "2.1.2",
    "node-fetch": "2.6.7",
    "node-fetch-native": "0.1.3",
    "node-forge": "1.3.1",
    "object-assign": "4.1.1",
    "object-hash": "3.0.0",
    "ohash": "0.1.0",
    "ohmyfetch": "0.4.17",
    "once": "1.4.0",
    "p-limit": "3.1.0",
    "proto3-json-serializer": "0.1.8",
    "protobufjs": "6.11.2",
    "pseudomap": "1.0.2",
    "pump": "3.0.0",
    "pumpify": "2.0.1",
    "radix3": "0.1.2",
    "readable-stream": "3.6.0",
    "retry-request": "4.2.2",
    "retry": "0.13.1",
    "safe-buffer": "5.2.1",
    "scule": "0.2.1",
    "semver": "6.3.0",
    "signal-exit": "3.0.7",
    "snakeize": "0.1.0",
    "source-map": "0.6.1",
    "source-map-support": "0.5.21",
    "stream-events": "1.0.5",
    "stream-shift": "1.0.1",
    "streamsearch": "1.1.0",
    "string_decoder": "1.3.0",
    "stubs": "3.0.0",
    "supports-color": "7.2.0",
    "teeny-request": "7.2.0",
    "tr46": "0.0.3",
    "tslib": "2.4.0",
    "typedarray-to-buffer": "3.1.5",
    "ufo": "0.8.4",
    "unenv": "0.5.2",
    "unique-string": "2.0.0",
    "unstorage": "0.4.1",
    "util-deprecate": "1.0.2",
    "uuid": "8.3.2",
    "vary": "1.1.2",
    "webidl-conversions": "3.0.1",
    "whatwg-url": "5.0.0",
    "wrappy": "1.0.2",
    "write-file-atomic": "3.0.3",
    "xdg-basedir": "4.0.0",
    "yallist": "2.1.2",
    "yocto-queue": "0.1.0",
    "@firebase/component": "0.5.13",
    "@firebase/database-compat": "0.1.8",
    "@firebase/util": "1.5.2",
    "@firebase/logger": "0.3.2",
    "@google-cloud/firestore": "4.15.1",
    "@google-cloud/paginator": "3.0.7",
    "@google-cloud/projectify": "2.1.1",
    "@google-cloud/promisify": "2.0.4",
    "@google-cloud/storage": "5.19.4",
    "@grpc/grpc-js": "1.6.7",
    "@grpc/proto-loader": "0.6.12",
    "@panva/asn1.js": "1.0.0",
    "@protobufjs/aspromise": "1.1.2",
    "@protobufjs/base64": "1.1.2",
    "@protobufjs/codegen": "2.0.4",
    "@protobufjs/eventemitter": "1.1.0",
    "@protobufjs/fetch": "1.1.0",
    "@protobufjs/float": "1.0.2",
    "@protobufjs/inquire": "1.1.0",
    "@protobufjs/path": "1.1.2",
    "@protobufjs/pool": "1.1.0",
    "@protobufjs/utf8": "1.1.0",
    "@tootallnate/once": "2.0.0"
  },
  "engines": {
    "node": "16"
  }
}
[2022-05-12T18:59:19.974Z] Building nodejs source
[2022-05-12T18:59:19.975Z] Analyzing nodejs backend spec
[2022-05-12T18:59:19.976Z] Could not find functions.yaml. Must use http discovery
[2022-05-12T18:59:19.984Z] Error: spawn ./node_modules/.bin/firebase-functions ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:9
  • Comments:13

github_iconTop GitHub Comments

9reactions
LaCocoRococommented, May 16, 2022

Same Problem. Workaround: Reinstall node modules from output server folder

  "scripts": {
    "dev": "nuxt dev",
    "build": "nuxt build",
    "clean": "cd .output/server && rm -rf node_modules && npm i",
    "deploy": "npm run build && npm run clean && firebase deploy"
  },
4reactions
skf-funztcommented, May 18, 2022

Currently, I’ve been using another workaround - till the issue is fixed of cause - by copying the needed files into the .ouput/server/node_modules with:

{
  "scripts": {
    "build": "nuxt build",
    "deploy:workaround": "mkdir .output/server/node_modules/.bin && cp -r node_modules/.bin/firebase-functions .output/server/node_modules/.bin && cp -rfu node_modules/firebase-functions/ .output/server/node_modules",
    "deploy": "yarn build && yarn deploy:workaround && firebase deploy"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Firebase deploy - An unexpected error has occurred
I have a few firebase functions working fine locally and am able to deploy to firebase using the firebase deploy --only functions command ......
Read more >
Distribute Android apps to testers using the Firebase CLI
This guide describes how to distribute APKs to testers using the Firebase CLI. The CLI tool lets you specify testers and release notes...
Read more >
failed to generate manifest from function source ... - You.com
I have the same issue. When I deploy firebase deploy --only functions --project staging. Error: Failed to load function definition from source: Failed...
Read more >
Nuxt3のエラー: Firebase tools 10.9.x deploy failed
Nuxt3のエラー: Firebase tools 10.9.x deploy failed · 事象 · 解決策 · Issue · 関連記事.
Read more >
firebase-tools - npm
Command-Line Interface for Firebase. Latest version: 11.19.0, last published: 4 days ago. Start using firebase-tools in your project by ...
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