I'm using SvelteKit and lottie-player and after updating npm, it is giving me this error all of a sudden:
[vite] Error when evaluating SSR module /src/routes/Loader.svelte: failed to import "@lottiefiles/lottie-player"
Internal server error: window is not defined
Doing this solved the error:
if (typeof window !== 'undefined') import('@lottiefiles/lottie-player')
I'm using SvelteKit and lottie-player and after updating npm, it is giving me this error all of a sudden:
Doing this solved the error:
if (typeof window !== 'undefined') import('@lottiefiles/lottie-player')
However, it shouldn't be the case. Strange...
Originally posted by @lessborders in https://github.com/airbnb/lottie-web/issues/2851#issuecomment-1242782840