Why does my Lottie animation load correctly on the localhost server but not on the deployment server?
P粉662614213
P粉662614213 2024-03-29 12:05:35
0
2
355

So the problem is that all the Lottie animations load on my localhost server, but once the web app is deployed the animations don't load and I get some errors in the console. Animation files are .json files. My project is next js React project.

Link to lottie: https://lottiefiles.com/

But when I open the deployment server (vercel), the animation fails to load and I get some errors in the console. How can I solve this problem?

P粉662614213
P粉662614213

reply all(2)
P粉200138510

Wherever you pass animationData, you can try JSON.stringify it

JSON.stringify(animationData)
P粉590428357

You are trying on vercel, there are some problems, please check this github issue and leave a comment https://github.com/vercel/next.js/issues/42801#issuecomment-1317671110, one One solution is to disable swcMinify

// next.config.js

module.exports = {
  swcMinify: false,
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!