File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @firebase/database " : patch
3
+ ---
4
+
5
+ Fixes an internal conflict when using v8 and v9 SDKs in the same package.
Original file line number Diff line number Diff line change @@ -123,8 +123,10 @@ try {
123
123
// @firebase /app when used together with the js sdk. More detail:
124
124
// https://github.com/firebase/firebase-js-sdk/issues/1696#issuecomment-501546596
125
125
// eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports
126
- const firebase = require ( '@firebase/app' ) . default ;
127
- registerDatabase ( firebase ) ;
126
+ const firebase = require ( '@firebase/app' ) . default ; // Only present for v8, undefined for v9 (should skip).
127
+ if ( firebase ) {
128
+ registerDatabase ( firebase ) ;
129
+ }
128
130
} catch ( err ) {
129
131
// catch and ignore 'MODULE_NOT_FOUND' error in firebase-admin context
130
132
// we can safely ignore this error because RTDB in firebase-admin works without @firebase/app
You can’t perform that action at this time.
0 commit comments