Skip to content

The "path" argument must be of type string. Received undefined #2233

Closed

Description

@long1eu

[REQUIRED] Environment info

firebase-tools: 8.2.0

Platform: macOS

[REQUIRED] Steps to reproduce

When I run firebase deploy --only firestore:rules I get this error:

[debug] [2020-05-11T23:36:17.216Z] ----------------------------------------------------------------------
[debug] [2020-05-11T23:36:17.220Z] Command:       /usr/local/bin/firebase /Users/long1eu/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase deploy --only firestore:rules
[debug] [2020-05-11T23:36:17.220Z] CLI Version:   8.2.0
[debug] [2020-05-11T23:36:17.220Z] Platform:      darwin
[debug] [2020-05-11T23:36:17.221Z] Node Version:  v12.16.1
[debug] [2020-05-11T23:36:17.222Z] Time:          Tue May 12 2020 02:36:17 GMT+0300 (Eastern European Summer Time)
[debug] [2020-05-11T23:36:17.223Z] ----------------------------------------------------------------------
[debug] [2020-05-11T23:36:17.223Z] 
[debug] [2020-05-11T23:36:17.238Z] > 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"]
[debug] [2020-05-11T23:36:17.239Z] > authorizing via signed-in user
[debug] [2020-05-11T23:36:17.239Z] [iam] checking project yitnow-dac3d for permissions ["datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get"]
[debug] [2020-05-11T23:36:17.244Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/yitnow-dac3d:testIamPermissions  
 {"permissions":["datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get"]}
[debug] [2020-05-11T23:36:18.174Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Mon, 11 May 2020 23:36:18 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=821","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,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,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-05-11T23:36:18.289Z] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:117:11)
    at Object.join (path.js:1039:7)
    at Object.checkFunctionsSDKVersion [as fn] (/Users/long1eu/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/checkFirebaseSDKVersion.js:33:28)
    at Command.<anonymous> (/Users/long1eu/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/command.js:159:30)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/long1eu/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/command.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error] 
[error] Error: An unexpected error has occurred.

Activity

  1. google-oss-bot commented on May 11, 2020

    @google-oss-bot
    Collaborator

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

  2. long1eu commented on May 11, 2020

    @long1eu
    Author

    I switched back to 7.16.0 and now it works.

  3. samtstern commented on May 12, 2020

    @samtstern
    Contributor

    @long1eu can you show me your firebase.json file?

  4. added
    Needs: Author Feedback
    on May 12, 2020
  5. long1eu commented on May 12, 2020

    @long1eu
    Author

    @samedson So glad you got the Google job.

    here it is:

    {
      "firestore": {
        "rules": "firestore.rules",
        "indexes": "firestore.indexes.json"
      },
      "functions": {
        "predeploy": [
          "npm --prefix \"$RESOURCE_DIR\" run lint",
          "npm --prefix \"$RESOURCE_DIR\" run build"
        ]
      }
    }
    
  6. added and removed
    Needs: Author Feedback
    on May 12, 2020
  7. samtstern commented on May 12, 2020

    @samtstern
    Contributor

    @long1eu this looks a bit similar to #2112 even though I hope it's not related. A few more questions:

    • Do both firestore.rules and firestore.indexes.json exist in the same directory as your firebase.json file?
    • Do you have a functions directory? If not can you run firebase init functions?
  8. long1eu commented on May 12, 2020

    @long1eu
    Author
    1. they are in the same directory
    2. I don't have a functions directory
  9. samtstern commented on May 12, 2020

    @samtstern
    Contributor

    @long1eu ok did you try running firebase init functions? or you could remove the functions part of your firebase.json.

  10. long1eu commented on May 12, 2020

    @long1eu
    Author

    I remove the functions from firebase.json and it works. Thank you so much

  11. samtstern commented on May 12, 2020

    @samtstern
    Contributor

    @long1eu ok gonna mark this as a duplicate of #2112 then! Glad it's working for you.

  12. monilpshah commented on Apr 24, 2021

    @monilpshah

    @long1eu this looks a bit similar to #2112 even though I hope it's not related. A few more questions:

    • Do both firestore.rules and firestore.indexes.json exist in the same directory as your firebase.json file?
    • Do you have a functions directory? If not can you run firebase init functions?

    Thanks! It resolved my query. In my case functions directory has some problem. 'firebase init functions' solved my error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions