File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @firebase/app ' : patch
3
+ ---
4
+
5
+ fix: server app should initialize in web workers
Original file line number Diff line number Diff line change @@ -48,7 +48,12 @@ import {
48
48
LogOptions ,
49
49
setUserLogHandler
50
50
} from '@firebase/logger' ;
51
- import { deepEqual , getDefaultAppConfig , isBrowser } from '@firebase/util' ;
51
+ import {
52
+ deepEqual ,
53
+ getDefaultAppConfig ,
54
+ isBrowser ,
55
+ isWebWorker
56
+ } from '@firebase/util' ;
52
57
53
58
export { FirebaseError } from '@firebase/util' ;
54
59
@@ -230,7 +235,7 @@ export function initializeServerApp(
230
235
_options : FirebaseOptions | FirebaseApp ,
231
236
_serverAppConfig : FirebaseServerAppSettings
232
237
) : FirebaseServerApp {
233
- if ( isBrowser ( ) ) {
238
+ if ( isBrowser ( ) && ! isWebWorker ( ) ) {
234
239
// FirebaseServerApp isn't designed to be run in browsers.
235
240
throw ERROR_FACTORY . create ( AppError . INVALID_SERVER_APP_ENVIRONMENT ) ;
236
241
}
You can’t perform that action at this time.
0 commit comments