-
Notifications
You must be signed in to change notification settings - Fork 910
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
Error: Service database is not available #6388
Comments
Hi @HaoboZ, I am unable to reproduce this. Do you have a minimal reproducible example? I tried running: const app = initializeApp(firebaseConfig);
const db = getDatabase(app);
const Home = () => <div>Home</div>; and didn't have any problems. |
Was trying to reproduce it, but after updating packages again it seems to work now? Downgrading to 9.8.3 seems to still have the problem, but the latest version seems to be fine now. |
@maneesht I just got this again, here's a reproduction of it https://github.com/HaoboZ/firebase-db-test. |
@HaoboZ I was able to reproduce this issue and it seems like database is the only product affected. We are looking into this. It seems to be isolated to 9.9.0. For the time being, can you use 9.8.4? |
Sounds good! Its such a weird bug since it failed when I just started using 9.8.4 as well, but afterwards, it worked, maybe because of a dependency? |
The interesting thing here is that I tried removing pnpm as the package manager and just used yarn and everything worked fine, regardless of the version. However, I created a new nextjs repo with pnpm and couldn't reproduce the issue. Still looking into this. |
This sounds like the sort of issue you get when there are multiple versions of Another thing to check is maybe a console.log() to see if |
I see, this seems like a problem of the packageExtensions for it to work with yarn PnP. Is there a way for this to resolve automatically? Without the packageExtensions, it will never build since it says auth and database needs app as dependencies, and with it, it won't update correctly. |
I applied the changes mentioned in my previous comment and left your packageExtensions as-is and it worked. In addition, the default setup created by |
the default create-next-app uses yarn without PnP. If you use PnP, it throws an error when trying to run it that says module not found, where I found a somewhat solution here #3707. However, it seems that if a new version comes out and you update firebase in package.json, it will not update those versions that were installed by yarnrc.yml. |
|
I'm going to go ahead and close this, as it seems like the original issue has been resolved. |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Steps to reproduce:
When using the database with
const db = getDatabase( app );
I get the errorError: Service database is not available
.Running using NextJS, happens on build if placed outside components, happens on client side if placed in useMemo. This works with 9.8.1 and stopped working when upgrading firebase package.
Relevant Code:
The text was updated successfully, but these errors were encountered: