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

Sharedrop keeps loading after deployment #155

Open
kenjibailly opened this issue May 20, 2023 · 13 comments
Open

Sharedrop keeps loading after deployment #155

kenjibailly opened this issue May 20, 2023 · 13 comments

Comments

@kenjibailly
Copy link

kenjibailly commented May 20, 2023

I think I might have done something wrong, as I'm not familiar, with the firebase db.
I created a realtime db, copied the link shown under the "Data" tab and put it in the FIREBASE_URL env.
I changed the rules to this:

{
  "rules": {
    ".read": true,
    ".write": true
  }
}
[Sign up](https://www.firebase.com/) for a Firebase account and create a database.
Go to "Security Rules" tab, click "Load Rules" button and select firebase_rules.json file.
Take note of your database URL and its secret, which can be found in "Secrets" tab.

I think some things might have changed on the firebase side as I couldn't find "Load Rules", just a Rules tab.
The "Secrets" tab I couldn't find that either. I guess it's all within the Rules editor now?

I put nothing in the FIREBASE_SECRET env (for testing).
Unfortunately I don't see any logs of not being able to connect to a firebase db.
So I'm not sure if it connects or not.

Can someone tell me what I'm doing wrong?

https://sharedrop.mindglowing.art/

@gabbelitoV2
Copy link

the same thing happens to me

@gabbelitoV2
Copy link

how can we solve it

@szimek
Copy link
Owner

szimek commented Jun 4, 2023

You can get FIREBASE_SECRET when you go to Project settings -> Service accounts -> Database secrets.

However, I do not know if these secrets are created for new Firebase projects, as they are marked as deprecated. FIREBASE_SECRET is only used to generate authentication token in server.js file. You might be able to update the code to use a non-deprecated solution to generate them, or even skip this part completely and have unauthenticated users.

@kenjibailly
Copy link
Author

You can get FIREBASE_SECRET when you go to Project settings -> Service accounts -> Database secrets.

However, I do not know if these secrets are created for new Firebase projects, as they are marked as deprecated. FIREBASE_SECRET is only used to generate authentication token in server.js file. You might be able to update the code to use a non-deprecated solution to generate them, or even skip this part completely and have unauthenticated users.

I found the secret and added the secret to the .env file, however it still keeps loading...

@szimek
Copy link
Owner

szimek commented Jun 7, 2023

@kenjibailly The error handling could be done better, but the error I'm getting on your page is the following:

"FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com "

Yours is: "https://sharedrop-mindglowingart-default-rtdb.europe-west1.firebasedatabase.app/"

@kenjibailly
Copy link
Author

I tried to find that "firebasio" url, but couldn't find it. So I just tried to change FIREBASE_URL with these:
https://sharedrop-mindglowingart.firebaseio.com/
https://sharedrop-mindglowingart-default-rtdb.europe-west1.firebaseio.com/

But they also keep loading.
All I can find is
https://sharedrop-mindglowingart-default-rtdb.europe-west1.firebasedatabase.app/

I'm not entirely sure how to proceed from here, thanks for answering though!

@szimek
Copy link
Owner

szimek commented Jun 8, 2023

For Sharedrop the FIREBASE_URL is https://sharedrop.firebaseio.com. This is the URL that I see in Firebase console when I go to "Realtime Database" and "Data":

sharedrop-firebase-url

If you deploy a new version with a correct FIREBASE_URL and it still doesn't work, let me know and I can see if I can find what's wrong. This would help me to update the docs to make it easier for others to deploy it themselves.

@szimek szimek changed the title Sharedrop keeps loading... Sharedrop keeps loading after deployment Jun 8, 2023
@kenjibailly
Copy link
Author

For Sharedrop the FIREBASE_URL is https://sharedrop.firebaseio.com. This is the URL that I see in Firebase console when I go to "Realtime Database" and "Data":

sharedrop-firebase-url

If you deploy a new version with a correct FIREBASE_URL and it still doesn't work, let me know and I can see if I can find what's wrong. This would help me to update the docs to make it easier for others to deploy it themselves.

Well that's the initial url I used, please have a look at my screenshot.
image

@szimek
Copy link
Owner

szimek commented Jun 8, 2023

Got it. Most likely the URL pattern has changed, but the ~10 year old version of the Firebase library used in Sharedrop does not support the new URL pattern :/ I can see if I can update the library, but it might be non-trivial, as a lot has changed :/

@kenjibailly
Copy link
Author

Got it. Most likely the URL pattern has changed, but the ~10 year old version of the Firebase library used in Sharedrop does not support the new URL pattern :/ I can see if I can update the library, but it might be non-trivial, as a lot has changed :/

Okay thank you for looking into it, please let us know if you got an update regarding this!

@gabbelitoV2
Copy link

I changed the json file and removed all . and $ and stuff like that
image
firebase.txt

@gabbelitoV2
Copy link

can it be a solution?
because then you can load that file

@githubxdax
Copy link

githubxdax commented May 18, 2024

Has someone found a workaround to the new URL format of Firebase databases?
Since every newly created database is not supported by the old library anymore.

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

4 participants