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

Query.toString as input to refFromURL doesn't work, throws error #7833

Open
marcusx2 opened this issue Dec 2, 2023 · 2 comments
Open

Query.toString as input to refFromURL doesn't work, throws error #7833

marcusx2 opened this issue Dec 2, 2023 · 2 comments

Comments

@marcusx2
Copy link

marcusx2 commented Dec 2, 2023

Operating System

macOS

Browser Version

Safari 16.5.2

Firebase SDK Version

10.6.0

Firebase SDK Product:

Database

Describe your project's tooling

index.html with source tag. Just javascript.

Describe the problem

The Query.toString() specifically says that the resulting URL is to be used with refFromURL. Yet, it doesn't work. It throws the error @firebase/database:"FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com ".

Steps and code to reproduce issue

const firebaseConfig = {
   ...
    databaseURL: "https://xxxxx-xxxxx-xxxxx-rtdb.europe-west1.firebasedatabase.app",
  ...
};


const app = initializeApp(firebaseConfig);
const db = getDatabase();
const postListRef = ref(db, 'posts');
refFromURL(db, postListRef.toString());
@marcusx2 marcusx2 added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Dec 2, 2023
@marcusx2
Copy link
Author

marcusx2 commented Dec 2, 2023

I also tried what is described on this SO post. It doesn't work either, I get the error

Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made.

@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Dec 4, 2023
@maneesht
Copy link
Contributor

@marcusx2 - unfortunately, I'm unable to reproduce your error. Here's what I tried:

    const db = getDatabase();
    const q = ref(db, 'posts');
    const url = q.toString();
    const r = refFromURL(db, url);
    console.log(r);

Let me know if you did something differently.
Also, if you could paste the stacktrace from your original error, that would be helpful.

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

No branches or pull requests

4 participants