-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Tell us about your environment
Node v21.2.0
Browser and Browser Version:
n/a
After Effects Version:
n/a
What did you do? Please explain the steps you took before you encountered the problem.
I'm running remix serve command which starts my web application's runtime.
What did you expect to happen?
I expected the lottie-web code not to rely on typeof navigator to determine environment
What actually happened? Please include as much relevant detail as possible.
/Users/sebastian.hewelt/Code/xyz/node_modules/lottie-web/build/player/lottie.js:30
return document.createElement(type);
^
ReferenceError: document is not definedThe code breaks because lottie.js checks for typeof navigator. This won't work anymore with Node.js v21+, because it's implemented navigator API. A discussion about other problems with it here.
The are many solutions options; one would be to find a more universal way to distinguish between environments, two - to check for document. 🙇🏻