Skip to content

Commit 5b1448e

Browse files
authored
fix: error when used on server side via SVGRenderer (#398)
1 parent 1399589 commit 5b1448e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libs/lottie.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
const lottie = /* @__PURE__ */ (() => {
2-
if (typeof navigator === 'undefined' || typeof document === 'undefined') return {}
2+
if (
3+
typeof navigator === 'undefined' ||
4+
typeof document === 'undefined' ||
5+
typeof CanvasRenderingContext2D === 'undefined'
6+
)
7+
return {}
38

49
const svgNS = 'http://www.w3.org/2000/svg'
510

0 commit comments

Comments
 (0)