Skip to content

Commit aad7674

Browse files
committed
fix(): check for console
Check if environment has console and console.error
1 parent 2b0d3d7 commit aad7674

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ const callDrivers =
2626
const noop = () => {}
2727

2828
const logErrorToConsole =
29-
err => console.error(err.stack || err)
29+
err => {
30+
const target = err.stack || err
31+
if (console && console.error) {
32+
console.error(target)
33+
}
34+
}
3035

3136
const replicateMany =
3237
(sinks, sinkProxies) =>

0 commit comments

Comments
 (0)