Skip to content

lottie files stored in public are failing to work, error Cannot read properties of undefined (reading 'length') #174

@bloodykheeng

Description

@bloodykheeng

I have stored my lottie files in public folder and when i try to use there url in src i get an error

lottie.js:491 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at completeLayers (lottie.js:491:32)
const Lottie = dynamic(() => import("lottie-react"), { ssr: false });
const NoDataLottie = "/lottie-files/nodata.json";
const SnailErrorLottie = "/lottie-files/snail-error-lottie.json";

function FaqsListing() {
    ...........rest of the code

 <div className="max-w-md">
         <Lottie animationData={SnailErrorLottie} loop autoplay />
  </div>

here are my versions

 "lottie-react": "^2.4.1",
"next": "16.0.7",
 "react": "19.2.1",
  "react-dom": "19.2.1",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions