diff --git a/lib/index.ts b/lib/index.ts index 0835321..ca79e99 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -137,7 +137,8 @@ export function detectPrng(allowInsecure: boolean = false, root?: any): PRNG { if (allowInsecure) { try { - console.error("secure crypto unusable, falling back to insecure Math.random()!") + // changed from console.error to console.info to avoid failure inside a service worker (console.error throws). + console.info("ERROR: secure crypto unusable, falling back to insecure Math.random()!") } catch (e) {} return () => Math.random() }