DevLog
Python, TypeScript, etc...
MyPage
Python, TypeScript, etc...
2022/06/12

Nuxt3のエラー: Firebase tools 10.9.x deploy failed

Nuxt.jsVue.js
preview
@shiromisanta
Frontend Engineer
  •  /
目次
事象

事象

現在beta版のnuxt3でfirebase functions, hostingを使っているときに発生。

firebase deployまたはfirebase emulators: startコマンドが下記のエラーで失敗する

$ firebase emulators:start ... i functions: Watching "/home/.../nuxt-app/.output/server" for Cloud Functions... Error: An unexpected error has occurred.

また、debug.logには下記の記載がある

[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.

解決策

issueを参考に下記のようなシェルスクリプトを書いてデプロイ時に叩くようにした。根本的解決とは言い難いのでissueを追いたい。

deploy.sh

set -eux NITRO_PRESET=firebase npm run build cd .output/server && rm -rf node_modules && npm i cd ../../ firebase deploy

Issue

https://github.com/nuxt/framework/issues/4961

関連記事

preview
@shiromisanta 2022/06/12
Nuxt.jsFirebase
preview
@shiromisanta 2022/06/12
Nuxt.jsVue.js
preview
@shiromisanta 2022/01/11
vee-validateVue.jsNuxt.js
2022/06/12

Nuxt3のエラー: Firebase tools 10.9.x deploy failed

Nuxt.jsVue.js

事象

現在beta版のnuxt3でfirebase functions, hostingを使っているときに発生。

firebase deployまたはfirebase emulators: startコマンドが下記のエラーで失敗する

$ firebase emulators:start ... i functions: Watching "/home/.../nuxt-app/.output/server" for Cloud Functions... Error: An unexpected error has occurred.

また、debug.logには下記の記載がある

[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.

解決策

issueを参考に下記のようなシェルスクリプトを書いてデプロイ時に叩くようにした。根本的解決とは言い難いのでissueを追いたい。

deploy.sh

set -eux NITRO_PRESET=firebase npm run build cd .output/server && rm -rf node_modules && npm i cd ../../ firebase deploy

Issue

https://github.com/nuxt/framework/issues/4961

関連記事

preview
@shiromisanta
Frontend Engineer
  •  /
©︎Devlog