Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined#1915

Closed
SeanDez opened this issue Jan 10, 2020 · 10 comments

Comments

@SeanDez
Copy link

SeanDez commented Jan 10, 2020

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.

@google-oss-bot
Copy link
Contributor

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

@SeanDez
Copy link
Author

SeanDez commented Jan 10, 2020

What field is missing?

@bkendall
Copy link
Contributor

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)

@bkendall
Copy link
Contributor

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

@bkendall bkendall added the Needs: Author Feedback Issues awaiting author feedback label Jan 10, 2020
@SeanDez
Copy link
Author

SeanDez commented Jan 10, 2020

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 SeanDez closed this as completed Jan 10, 2020
@bkendall bkendall removed the Needs: Author Feedback Issues awaiting author feedback label Jan 16, 2020
@doublejosh
Copy link

doublejosh commented Apr 7, 2020

@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.

@tstirrat
Copy link

tstirrat commented Apr 7, 2020

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

@albertvp
Copy link

albertvp commented Apr 23, 2020

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.
firebase@7.14.1
node@14
Worked downgrading to firebase-tools@8.0.3

@kamaladenalhomsi
Copy link

After spending more than one hour playing around with my config files, also I updated my nodejs and firebase-tools to latest, I still had had this error, I fixed it by removing hosting cache in .firebase directory

@juangaviria27cobalto
Copy link

@kamaladenalhomsi
saved my day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants