Skip to content

Paths must be non-empty strings and can't contain '.', '#', '$', '[', or ']' #4175

@binar1

Description

@binar1

I had some problem in using react-native-firebase when I write any Query this error will be shown ,
So after Some looking of last commits i found out the issue is a validation in index.js

if (/[.#$\[\]'?]/g.test(path)) { throw new Error( "Paths must be non-empty strings and can't contain '.', '#', '$', '[', or ']'", ); }

Because First this Method will be Run

_syncServerTimeOffset() {
   this.ref('.info/serverTimeOffset').on('value', snapshot => {
     console.log(snapshot.val());
     
     this._serverTimeOffset = snapshot.val();
   });
 } 

and it Has => . from its Path so Error will be Shown .

after removing => . from regular expression the error will be fixed like this

if (/[#$\[\]'?]/g.test(path)) {
      throw new Error(
        "Paths must be non-empty strings and can't contain '.', '#', '$', '[', or ']'",
      );
    }

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