firebase-functions-test icon indicating copy to clipboard operation
firebase-functions-test copied to clipboard

Cannot read property 'DataSnapshot' of undefined

Open dan-wu-open opened this issue 3 years ago • 1 comments
trafficstars

Version info

firebase-functions-test: 2.3.0

firebase-functions: 3.21.2

firebase-admin: 10.2.0

Bug

Throws an error "Cannot read property 'DataSnapshot' of undefined". https://github.com/firebase/firebase-functions-test/blob/master/src/cloudevent/generate.ts#L44

database is not exported from firebase-functions until version 3.22.0. https://github.com/firebase/firebase-functions/pull/1127/files#diff-3b2670242bbd05b6c18120f99c3e59ad0500d7c3227d3c548727f21b53b78282R43

Fix

Upgrade firebase-functions to 3.22.0 worked for me. I see it's a peerDependency, so the README just needs to be updated.

I tried opening a PR but I don't have permission.

dan-wu-open avatar Aug 30 '22 21:08 dan-wu-open

Based on this, perhaps NOTE: This library can only be used with firebase-functions v3.20.1 or above. (in README.md) could be modified to v3.22.0.

CorieW avatar Dec 20 '24 14:12 CorieW