Open gaplo917 opened 2 years ago
The lottie.useWebWorker(true) feature does not work in the minified environment.
lottie.useWebWorker(true)
using https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.min.js and lottie.useWebWorker(true)
https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.min.js
Codesandbox: https://codesandbox.io/s/lottie-web-5-9-6-web-worker-bug-ndjm6i?file=/pages/_app.tsx:385-399 GitHub Repo: https://github.com/gaplo917/nextjs-lottie-webworker-sample/tree/lottie-web-5.9.6-min
Uncaught ReferenceError: a is not defined at self.onmessage (a0f03980-2142-4dfa-af78-89a0880123af:1:54)
using https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.js and lottie.useWebWorker(true)
https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.js
Codesandbox: https://codesandbox.io/s/lottie-web-5-9-6-web-worker-nextjs-mnvkjd?file=/pages/_app.tsx:512-630 GitHub Repo: https://github.com/gaplo917/nextjs-lottie-webworker-sample/tree/lottie-web-5.9.6
Hi, I'm thinking of deprecating this method in favor of using the lottie_worker.js. Do you have a use case where you'd prefer using this one instead?
The
lottie.useWebWorker(true)
feature does not work in the minified environment.Environment
Reproduce
using
https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.min.js
andlottie.useWebWorker(true)
Codesandbox: https://codesandbox.io/s/lottie-web-5-9-6-web-worker-bug-ndjm6i?file=/pages/_app.tsx:385-399 GitHub Repo: https://github.com/gaplo917/nextjs-lottie-webworker-sample/tree/lottie-web-5.9.6-min
Expected Working Example
using
https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.js
andlottie.useWebWorker(true)
Codesandbox: https://codesandbox.io/s/lottie-web-5-9-6-web-worker-nextjs-mnvkjd?file=/pages/_app.tsx:512-630 GitHub Repo: https://github.com/gaplo917/nextjs-lottie-webworker-sample/tree/lottie-web-5.9.6