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
現在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