Browse Source

Lottie: Add document check for SSR. (#26989)

Cody Bennett 1 year ago
parent
commit
de5932e063
1 changed files with 6 additions and 1 deletions
  1. 6 1
      examples/jsm/libs/lottie_canvas.module.js

+ 6 - 1
examples/jsm/libs/lottie_canvas.module.js

@@ -1,3 +1,7 @@
+const lottie = {};
+
+if (typeof document !== 'undefined') {
+
 const svgNS = 'http://www.w3.org/2000/svg';
 const svgNS = 'http://www.w3.org/2000/svg';
 
 
 let locationHref = '';
 let locationHref = '';
@@ -4547,7 +4551,6 @@ const Matrix = (function () {
   };
   };
 }());
 }());
 
 
-const lottie = {};
 var standalone = '__[STANDALONE]__';
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
 var renderer = '';
@@ -14841,4 +14844,6 @@ setExpressionsPlugin(Expressions);
 initialize$1();
 initialize$1();
 initialize();
 initialize();
 
 
+}
+
 export { lottie as default };
 export { lottie as default };