Skip to content

Commit a632b8b

Browse files
Add window.navigator check
1 parent 3e7dd37 commit a632b8b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/firestore/src/local/simple_db.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ export class SimpleDb {
154154
return true;
155155
}
156156

157+
// In some Node environments, `window` is defined, but `window.navigator` is
158+
// not. We don't support IndexedDB persistence in Node if the
159+
// `isMockPersistence()` check above returns false.
160+
if (window.navigator === undefined) {
161+
return false;
162+
}
163+
157164
// We extensively use indexed array values and compound keys,
158165
// which IE and Edge do not support. However, they still have indexedDB
159166
// defined on the window, so we need to check for them here and make sure

0 commit comments

Comments
 (0)