firebase / firebase-functions-test

MIT License
232 stars 48 forks source link

Support `firebase-admin` v11.0 / npm peer dependency warning after upgrade of `firebase-admin` #157

Closed sceee closed 1 year ago

sceee commented 2 years ago

Version info

firebase-functions-test: 2.2.0

firebase-functions: 3.21.2

firebase-admin: 11.0.0

Test case

n/a, peer dependency warning emitted by npm 8. Relates to https://github.com/firebase/firebase-functions/issues/1147 .

Steps to reproduce

Update firebase-admin to v11 using the above mentioned versions for firebase-functions-test and firebase-functions.

The following peer dependency warning is emitted by npm:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: functions@undefined
npm WARN Found: firebase-admin@10.3.0
npm WARN node_modules/firebase-admin
npm WARN   firebase-admin@"^11.0.0" from the root project
npm WARN   2 more (firebase-functions, firebase-functions-test)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer firebase-admin@"^8.0.0 || ^9.0.0 || ^10.0.0" from firebase-functions@3.21.2
npm WARN node_modules/firebase-functions
npm WARN   firebase-functions@"^3.21.2" from the root project
npm WARN   1 more (firebase-functions-test)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: functions@undefined
npm WARN Found: firebase-admin@10.3.0
npm WARN node_modules/firebase-admin
npm WARN   firebase-admin@"^11.0.0" from the root project
npm WARN   2 more (firebase-functions, firebase-functions-test)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer firebase-admin@"^8.0.0 || ^9.0.0 || ^10.0.0" from firebase-functions@3.21.2
npm WARN node_modules/firebase-functions
npm WARN   firebase-functions@"^3.21.2" from the root project
npm WARN   1 more (firebase-functions-test)

Expected behavior

firebase-functions-test is compatible with firebase-admin v11 and npm does not emit the peer dependency warning.

Actual behavior

See above.

mpsq commented 2 years ago

Note that using this package with firebase-admin 11 also breaks, Timestamp instances are not recognized anymore:

Cannot encode 063776714400.000000000to a Firestore Value. Local testing does not yet support objects of type Timestamp.
TheIronDev commented 1 year ago

@sceee

Thank you for the bug report! This should be fixed with firebase-functions@3.22 with https://github.com/firebase/firebase-functions/pull/1151.

Please let me know if you're seeing the issue given firebase-functions@3.22.

@mpsq

Is this still reproducible with the latest version of firebase-function? Do you have an example repo I could take a look at?

sceee commented 1 year ago

@TheIronDev Thanks, I can confirm this was resolved in the meantime as you mentioned.

mpsq commented 1 year ago

@TheIronDev This is now fixed ;) issue was on my side.

TheIronDev commented 1 year ago

@sceee @mpsq

Thank you for checking again!!