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-tools dependency #3479

Closed
alexfung888 opened this issue Dec 14, 2023 · 12 comments
Closed

firebase-tools dependency #3479

alexfung888 opened this issue Dec 14, 2023 · 12 comments

Comments

@alexfung888
Copy link

alexfung888 commented Dec 14, 2023

Version info

Angular: 17.0.7

Firebase: 10.7.1

AngularFire: 17.0.0

Other (e.g. Ionic/Cordova, Node, browser, operating system):
node: 18.18.0
OS: windows 11

How to reproduce these conditions

Failing test unit, Stackblitz demonstrating the problem

any repo

Steps to set up and reproduce

yarn

Sample data and security rules
any

Debug output

** Errors in the JavaScript console **
none

** Output from firebase.database().enableLogging(true); **
none

** Screenshots **
N/A

Expected behavior

successful compilation

Actual behavior

➤ YN0060: │ mysite@workspace:. provides firebase-tools (p4391f) with version 13.0.1, which doesn't satisfy what @angular/fire requests

https://github.com/angular/angularfire/blob/master/src/package.json says:

  "peerDependencies": {
    "firebase-tools": "^12.0.0"
  },

but https://github.com/angular/angularfire/blob/master/package.json says

  "dependencies": {
    "firebase-tools": "^13.0.0"
  },
@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@alexfung888
Copy link
Author

This issue does not seem to follow the issue template. Make sure you provide all the required information.

Fixed

@jamesdaniels
Copy link
Member

Good find, we'll get that patched up.

I should try to get it so we don't have two package.json files, if i can't achieve that without a big refactor I'll add unit tests to make sure the deps match.

@YouZag
Copy link

YouZag commented Dec 21, 2023

I'm a little bit confused on what I should do to install Angular Fire being that this makes it fail.

@jamesdaniels
Copy link
Member

jamesdaniels commented Dec 21, 2023

The easiest fix would be not to have firebase-tools in your package.json, rather use a globally installed firebase-tools or use NPX. We generally recommend you don't have firebase-tools in your package.json, since it's a very large dependency & is shrinkwrapped, increasing the likelihood of a version conflict.

@alexfung888
Copy link
Author

The easiest fix would be not to have firebase-tools in your package.json, rather use a globally installed firebase-tools or use NPX. We generally recommend you don't have firebase-tools in your package.json, since it's a very large dependency & is shrinkwrapped, increasing the likelihood of a version conflict.

yarn does not have global any more.

If I use dlx, it seems to me that yarn would be downloading and binding the firebase-tools afresh everytime, taking quite a while to execute.

@egorkel-altexsoft
Copy link

Why do you have firebase-tools as peerDependencies? Especially with a fixed version? I have ng16 and have to use v16, but I can't use latest firebase-tools in my repo (which is 13 at the moment).

@alexfung888
Copy link
Author

Why do you have firebase-tools as peerDependencies? Especially with a fixed version? I have ng16 and have to use v16, but I can't use latest firebase-tools in my repo (which is 13 at the moment).

@egorkel-altexsoft I need to issue firebase commands, and I didn't want install firebase-tools as global (and now yarn does not have global at all). Ins't that what devdep means? They are tools I need for the development cycle.

@egorkel-altexsoft
Copy link

Ok, what should I do if I have to use version 16 and need the latest fb-tools?
Now I have:
@angular/core: 16
@angular/fire: 16
And as a dev dependency
firebase-tools: 12 (I can't use 13 because of conflicts with @angular/fire peer dependency)

@alexfung888
Copy link
Author

Ok, what should I do if I have to use version 16 and need the latest fb-tools? Now I have: @angular/core: 16 @angular/fire: 16 And as a dev dependency firebase-tools: 12 (I can't use 13 because of conflicts with @angular/fire peer dependency)

Ignore the peer dependency. As raised in this issue, the firebase-tools have dependency on both ^12 and ^13.

@egorkel-altexsoft
Copy link

Version 16 has only one fb tools version ^12. And I can't ignore peer dependency in my CI. When I run npm ci it fails.
Anyway, for now I rolled back to fb tools 12. But it's not a good idea to restrict both ng and fb tools versions. They are not related and have different development cycle. Or you have to support older ng version, i. g. v16.0.1 to allow both 12 and 13 fb tools.

@alexfung888
Copy link
Author

Version 16 has only one fb tools version ^12. And I can't ignore peer dependency in my CI. When I run npm ci it fails. Anyway, for now I rolled back to fb tools 12. But it's not a good idea to restrict both ng and fb tools versions. They are not related and have different development cycle. Or you have to support older ng version, i. g. v16.0.1 to allow both 12 and 13 fb tools.

Please read the issue I raised. https://github.com/angular/angularfire/blob/master/package.json says

  "dependencies": {
    "firebase-tools": "^13.0.0"
  },

I raised the issue because https://github.com/angular/angularfire/blob/master/src/package.json is wrong.

If your CI cannot accept peer dependency conflict, then you really need to use npm global or yarn dlx without adding firebase-tools to your repository.

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