You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nuxt3应用Firebase部署报错:TypeError: Cannot read properties of null (reading 'match')

Firebase部署Nuxt3项目时遭遇Unexpected Error问题求助

GitHub仓库地址:https://github.com/toriumi72/LINE_shift/tree/master

背景信息

  • 部署命令:firebase deploy
  • Firebase工具版本:最新版(截至2023年9月19日)
  • Node版本:18

错误信息

=== Deploying to 'line-shift'...
i  deploying storage, firestore, functions, hosting
i  firebase.storage: checking storage.rules for compilation errors...
✔  firebase.storage: rules file storage.rules compiled successfully
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
✔  cloud.firestore: rules file firestore.rules compiled successfully
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 cloudbuild.googleapis.com is enabled
✔  functions: required API cloudfunctions.googleapis.com is enabled
✔  artifactregistry: required API artifactregistry.googleapis.com is enabled
i  functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8875
shutdown requested via /__/quitquitquit
Error: An unexpected error has occurred.

调试信息

我用--debug参数重新执行部署命令获取了更多细节,以下是错误发生时的调试日志片段:

... 
[debug] [2023-09-19T01:45:05.303Z] Could not find functions.yaml. Must use http discovery 
[debug] [2023-09-19T01:45:05.307Z] Found firebase-functions binary at '/Users/User2/Desktop/Desktop/LINE-shift/node_modules/.bin/firebase-functions' 
[info] Serving at port 8149 
[debug] [2023-09-19T01:45:05.478Z] Got response from /__/functions.yaml {"endpoints":{"server":{"platform":"gcfv1","availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"serviceAccountEmail":null,"vpc":null,"region":[null],"httpsTrigger":{},"entryPoint":"server"}},"specVersion":"v1alpha1","requiredAPIs":[]} 
[info] shutdown requested via /__/quitquitquit 
[debug] [2023-09-19T01:45:10.643Z] TypeError: Cannot read properties of null (reading 'match') at resolveString (/opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/functions/params.js:31:27) at /opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/functions/params.js:47:36 at Array.map (<anonymous>) at Object.resolveList (/opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/functions/params.js:47:21) at toBackend (/opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/functions/build.js:180:30) at Object.resolveBackend (/opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/functions/build.js:73:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async prepare (/opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/functions/prepare.js:68:62) at async chain (/opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/index.js:38:9) at async deploy (/opt/homebrew/lib/node_modules/firebase-tools/lib/deploy/index.js:95:5) 
[error] 
[error] Error: An unexpected error has occurred. 

已尝试更新Firebase工具到最新版本、重启电脑,问题仍未解决。求解决思路或相关经验,感谢!

内容的提问来源于stack exchange,提问作者umi tori

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 16:15:01