Firebase-tools: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined

Created on 10 Jan 2020  路  8Comments  路  Source: firebase/firebase-tools


firebase-tools:

7.11.0


Platform:

Linux

[REQUIRED] Steps to reproduce

  1. run firebase serve --debug
  2. Title error will occur.

[REQUIRED] Expected behavior

Emulators start on default ports.

[REQUIRED] Actual behavior

owner@G700:~/PhpstormProjects/shopify/buyUsedServer$ firebase serve --debug
[2020-01-10T21:56:29.047Z] ----------------------------------------------------------------------
[2020-01-10T21:56:29.060Z] Command:       /home/owner/.nvm/versions/node/v10.16.3/bin/node /usr/local/bin/firebase serve --debug
[2020-01-10T21:56:29.061Z] CLI Version:   7.11.0
[2020-01-10T21:56:29.061Z] Platform:      linux
[2020-01-10T21:56:29.061Z] Node Version:  v10.16.3
[2020-01-10T21:56:29.062Z] Time:          Sat Jan 11 2020 04:56:29 GMT+0700 (Indochina Time)
[2020-01-10T21:56:29.064Z] ----------------------------------------------------------------------
[2020-01-10T21:56:29.064Z] 
[2020-01-10T21:56:29.083Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2020-01-10T21:56:29.083Z] > authorizing via signed-in user
[2020-01-10T21:56:29.084Z] [iam] checking project buyusedshopify for permissions ["firebase.projects.get"]
[2020-01-10T21:56:29.087Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/buyusedshopify:testIamPermissions  
 permissions=[firebase.projects.get]
[2020-01-10T21:56:30.516Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 10 Jan 2020 21:56:30 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=1191, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-10T21:56:30.519Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/buyusedshopify  

[2020-01-10T21:56:31.188Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 10 Jan 2020 21:56:31 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked

=== Serving from '/home/owner/PhpstormProjects/shopify/buyUsedServer'...

[2020-01-10T21:56:31.194Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/buyusedshopify/webApps/-/config  

[2020-01-10T21:56:31.197Z] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:125:11)
    at Object.join (path.js:1147:7)
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/serve/functions.js:20:39)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/firebase-tools/lib/serve/functions.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/firebase-tools/lib/serve/functions.js:3:12)
    at Object.start (/usr/local/lib/node_modules/firebase-tools/lib/serve/functions.js:18:16)
    at /usr/local/lib/node_modules/firebase-tools/lib/serve/index.js:15:23
    at arrayMap (/usr/local/lib/node_modules/firebase-tools/node_modules/lodash/lodash.js:639:23)
    at Function.map (/usr/local/lib/node_modules/firebase-tools/node_modules/lodash/lodash.js:9554:14)
    at _serve (/usr/local/lib/node_modules/firebase-tools/lib/serve/index.js:13:26)
    at Command.module.exports.Command.description.option.option.option.option.before.action [as actionFn] (/usr/local/lib/node_modules/firebase-tools/lib/commands/serve.js:58:12)
    at Command.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/command.js:156:25)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/firebase-tools/lib/command.js:4:58)

Error: An unexpected error has occurred.

Note

I had to explicitly uninstall my global firebase install prior to it updating from 4.0.2 (in previous bug report) to 7.11.0. But as you can see it is on the new version now.

Most helpful comment

In your firebase.json file, do you have a value set for functions, or functions.source? If you do, that may be causing this issue. (The docs regarding that setting)

All 8 comments

This issue does not seem to follow the issue template. Make sure you provide all the required information.

What field is missing?

In your firebase.json file, do you have a value set for functions, or functions.source? If you do, that may be causing this issue. (The docs regarding that setting)

(don't worry about the bot's message - the missing section is "Test Case", though)

I do not but I theorized that I may need to run firebase init again in case it would add new settings. It did not add a source property but the emulators have successfully loaded as a result anyways.

During the new init

  • I overwrote files I did not touch, mainly config files.
  • I did not overwrite my typescript or server related files (I'd been working in /functions)

@SeanDez Confirmed. After cloning a working firebase repo and running npm install I wasn't able to run firebase deploy ...couldn't get to the step ensuring "all necessary APIs are enabled."\

After running firebase init everything works fine.

This also fails if you have functions emulator port specified and there is no functions directory structure: #2112

Same issue of validateString with the same TypeError but doing any deploy firebase deploy --only hosting. Even logging out and in, creating a new project and reinitializing the whole firebase config files. Using Firestore & Hosting only.
[email protected]
node@14
Worked downgrading to [email protected]

Was this page helpful?
0 / 5 - 0 ratings