Jhonny Carvajal Perez
Jhonny Carvajal Perez

Reputation: 102

Error when trying to execute "firebase deploy" in React App

When trying to deploy my React application, after having done "npm run build" and after configure the hosting in "firebase.json" file, the whole firebase process runs correctly until I get the message "Error: An unexpected error has occurred." checking the file "firebase-debug.log" I find this problem:

TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at release (C:\Users\Jhonny\AppData\Roaming\nvm\v16.0.0\node_modules\firebase-tools\lib\deploy\functions\release.js:47:10)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[error] 
[error] Error: An unexpected error has occurred.

This problem is solved by directly modifying the Node file but then another similar message appears, and so on, also I don't think it is the correct solution.

Node version: 14.17 LTS

Thanks in advance

Upvotes: 4

Views: 586

Answers (2)

nutr0n
nutr0n

Reputation: 1

Simply, upgrade node by running the following command in your terminal:

npm install node

Upvotes: 0

hideo54
hideo54

Reputation: 26

One possibility is that you forget to export the function like:

export const func = functions. // ...

Upvotes: 1

Related Questions