0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Nuxt3でFirebase Hostingデプロイ時に Error: Failed to find location of Firebase Functions SDK. エラー

Posted at

Nuxt3をSSRでFirebase Hostingにデプロイしようとしたときにエラーになり詰まったのでメモ

バージョン

  • Nuxt 3.3.3
  • Firebase 9.9.1
  • Firebase functions 4.4.1

エラー

CDからfirebase deployでデプロイしようとしたところ以下のエラーが発生

=== Deploying to 'project'...

i  deploying functions, hosting
i  functions: preparing codebase default for deployment
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔  functions: required API cloudfunctions.googleapis.com is enabled
✔  artifactregistry: required API artifactregistry.googleapis.com is enabled
✔  functions: required API cloudbuild.googleapis.com is enabled

Error: Failed to find location of Firebase Functions SDK. Please file a bug on Github (https://github.com/firebase/firebase-tools/).

firebase deploy --debugで詳細を見てみる

[2023-08-11T09:35:49.979Z] Building nodejs source
[2023-08-11T09:35:49.981Z] Could not find functions.yaml. Must use http discovery

Error: Failed to find location of Firebase Functions SDK. Please file a bug on Github (https://github.com/firebase/firebase-tools/).

対応

functions.yamlがないとのことだが、諸々調べてみたところ以下の様に、手動でファイルをコピーすれば良さそうとのこと

コメントを参考に以下を実行してから firebase deployで問題なくデプロイできた

$ mkdir .output/server/node_modules/.bin
$ cp -r node_modules/.bin/firebase-functions .output/server/node_modules/.bin
$ rm -rf .output/server/node_modules/firebase-functions/node_modules/protobufjs
$ cp -rfu node_modules/firebase-functions/ .output/server/node_modules
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?