Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase deploy gives a "path" error

After initiating my firebase app with

firebase init

I tried to deploy it with

firebase deploy

but I get this error

    === Deploying to 'fugis-auto-services-website'...

i  deploying database, storage, functions, hosting

Error: An unexpected error has occurred.

So I looked at the firebase-debug.log and this is what it says

Tue May 01 2018 19:52:19 GMT-0500 (CDT)
[debug] [2018-05-02T00:52:19.967Z] <<< HTTP RESPONSE 200
[info] 
[info] === Deploying to 'fugis-auto-services-website'...
[info] 
[info] i  deploying database, storage, functions, hosting
[debug] [2018-05-02T00:52:20.266Z] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.join (path.js:1157:7)
    at Config.path (/Users/vanessaflores/.nvm/versions/node/v10.0.0/lib/node_modules/firebase-tools/lib/config.js:166:37)
    at /Users/vanessaflores/.nvm/versions/node/v10.0.0/lib/node_modules/firebase-tools/lib/deploy/lifecycleHooks.js:68:38
    at _chain (/Users/vanessaflores/.nvm/versions/node/v10.0.0/lib/node_modules/firebase-tools/lib/deploy/index.js:26:38)
    at /Users/vanessaflores/.nvm/versions/node/v10.0.0/lib/node_modules/firebase-tools/lib/deploy/index.js:29:14
    at process._tickCallback (internal/process/next_tick.js:178:7)
[error] 
[error] Error: An unexpected error has occurred.

I'm not sure how to proceed.

like image 330
Vanessa Flores Avatar asked May 02 '18 01:05

Vanessa Flores


2 Answers

I was able to fix this by re-initializing firebase functions:

firebase init functions

You might want to first update your firebase-tools:

npm install -g firebase-tools

and backup your existing functions directory.

like image 141
Justin Avatar answered Oct 15 '22 11:10

Justin


Too late to answer but might help someone in future, I had the same issue, i added the public folder as mentioned by @Gleb and inside your firebase.json you need to specify the public folder as well, like so:

{
"hosting": {
"public": "public",
"rewrites": [
  {
    "source": "**",
    "function": "helloWorld"
  }
]
}
}
like image 36
Deo Avatar answered Oct 15 '22 09:10

Deo