We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8b950f commit b97c7e7Copy full SHA for b97c7e7
.changeset/silver-trainers-rhyme.md
@@ -0,0 +1,5 @@
1
+---
2
+"@firebase/firestore": patch
3
4
+
5
+Enable fallback for auto-generated identifiers in environments that support `crypto` but not `crypto.getRandomValues`.
packages/firestore/src/platform/browser/random_bytes.ts
@@ -30,7 +30,7 @@ export function randomBytes(nBytes: number): Uint8Array {
30
// eslint-disable-next-line @typescript-eslint/no-explicit-any
31
typeof self !== 'undefined' && (self.crypto || (self as any)['msCrypto']);
32
const bytes = new Uint8Array(nBytes);
33
- if (crypto) {
+ if (crypto && typeof crypto.getRandomValues === 'function') {
34
crypto.getRandomValues(bytes);
35
} else {
36
// Falls back to Math.random
0 commit comments