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

firebase/database-compat - Breaks the node version requirement #8583

Closed
sanhardik opened this issue Oct 22, 2024 · 15 comments
Closed

firebase/database-compat - Breaks the node version requirement #8583

sanhardik opened this issue Oct 22, 2024 · 15 comments

Comments

@sanhardik
Copy link

Operating System

Ubuntu

Environment (if applicable)

NodeJs 16.20.2

Firebase SDK Version

12.1.1

Firebase SDK Product(s)

Database

Project Tooling

NodeJS backend using firebase-admin v12.1.1

Detailed Problem Description

We are running our code on Node 16 due to some other dependency issues.
We use firebase-admin v12.1.1
The firebase-admin has got a dependency on @firebase/database-compat
"@firebase/database-compat": "^1.0.2",

The recent version of @firebase/database-compat introduced the minimum node version as 18, thus breaking all our build.
error @firebase/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "16.20.2"

I would have thought that updates like this would need a major version change as it breaks existing code bases.

Fixing an older version of firebase-admin's package to fix it to a version might not be an option.

My suggestion is to revert the change on @firebase/[email protected] to allow older node version and build a new major release

Steps and code to reproduce issue

Install firebase-admin on Node16

@sanhardik sanhardik added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Oct 22, 2024
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@argzdev argzdev added api: database and removed needs-triage new A new issue that hasn't be categoirzed as question, bug or feature request labels Oct 22, 2024
@dlarocque
Copy link
Contributor

Hey @sanhardik, thanks for reporting this issue. We recently did a major version release (v11) of the Firebase JS SDK where we dropped support for Node <18.

Node 16 has reached EOL (https://nodejs.org/en/blog/announcements/nodejs16-eol) and it's highly recommended to upgrade. Would it be possible to upgrade to Node 18 to resolve this?

@sanhardik
Copy link
Author

sanhardik commented Oct 22, 2024 via email

@dlarocque
Copy link
Contributor

@sanhardik No worries if you can't upgrade to Node 18.

To resolve this, we will release a new version of @firebase/database-compat that reverts the Node >=18 requirement, so that the next time you install your dependencies you will have a version that does not require Node 18. I will share an update here when that process is finished.

@sanhardik
Copy link
Author

sanhardik commented Oct 22, 2024 via email

@dlarocque
Copy link
Contributor

@sanhardik Yes, we will make a separate major release for the version of database-compat that requires Node >16, so this issue should not occur again in the future.

@sanhardik
Copy link
Author

sanhardik commented Oct 22, 2024 via email

@dlarocque
Copy link
Contributor

dlarocque commented Oct 22, 2024

@sanhardik This should be fixed now. Can you try re-installing and confirm this?

@sanhardik
Copy link
Author

sanhardik commented Oct 22, 2024 via email

@dlarocque
Copy link
Contributor

Hello, The issue with database-compat got resolved but now I am seeing issues with @@.*** @@.*** @@.*** @@.***

I am not sure what that error message is. Did it get formatted correctly?

@sanhardik
Copy link
Author

Sorry, I had replied back with email causing the issues

The error is
The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "16.20.2"

For these packages

@dlarocque
Copy link
Contributor

@sanhardik Thanks for sharing the error again- really sorry for the trouble.

To fix this, the Firebase Admin Node SDK has released a new version that pins the versions of @firebase/ dependencies to ones that don't require Node 18.
Could you try upgrading to "firebase-admin": "12.7.0" to get these pinned dependencies?

@sanhardik
Copy link
Author

Hello,
Sorry for the delay.
I did update the firebase-admin to 12.7.0.

I am now seeing an error with farmhash-modern
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "16.20.2"

@dlarocque
Copy link
Contributor

Hello, Sorry for the delay. I did update the firebase-admin to 12.7.0.

I am now seeing an error with farmhash-modern error [email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "16.20.2"

Hi @sanhardik, thanks for the update. This seems to be a different issue- farmhash-modern is a dependency of the Admin SDK. Could you please report this in a new issue in https://github.com/firebase/firebase-admin-node?

While this is still unresolved, you may be able to use selective version resolutions with your previous version of the Admin SDK (12.1.1), and add the following to your package.json:

"resolutions": {
    "@firebase/database-compat": "1.0.8", 
    "@firebase/database-types": "1.0.5" 
  }

@sanhardik
Copy link
Author

I have reported the issue at firebase/firebase-admin-node#2753

@firebase firebase locked and limited conversation to collaborators Nov 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants