Skip to content

Invalid token in path when trying to create ref to '.info/connected' #6127

@Nantris

Description

@Nantris

[REQUIRED] Describe your environment

  • Operating System version: Windows 7
  • Browser version: Electron 17.x
  • Firebase SDK version: 9.6.7
  • Firebase Product: Realtime database

[REQUIRED] Describe the problem

Following the example code here yields an error about invalid tokens in the path.

https://firebase.google.com/docs/database/web/offline-capabilities#web-version-9_5

Steps to reproduce:

Run example code: https://firebase.google.com/docs/database/web/offline-capabilities#web-version-9_5

Relevant Code:

From the linked example:

import { getDatabase, ref, onValue } from "firebase/database";

const db = getDatabase();
const connectedRef = ref(db, ".info/connected");
onValue(connectedRef, (snap) => {
  if (snap.val() === true) {
    console.log("connected");
  } else {
    console.log("not connected");
  }
});

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