Skip to content
This repository was archived by the owner on Aug 26, 2023. It is now read-only.
This repository was archived by the owner on Aug 26, 2023. It is now read-only.

"Cannot read property 'loadAnimation' of undefined" running render-snapshot.js example #23

@meo85

Description

@meo85

Expected behavior

render-snapshot.js runs correctly

Actual behavior

script fails on window.lottie.loadAnimation with this error:

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'loadAnimation' of undefined
at /Users/meo/node_modules/lottie-node/index.js:63:24
at /Users/meo/Downloads/render-snapshot.js:11:21

which means that eval didn't create lottie object

Steps to reproduce

node render-snapshot.js test.json test.png

Environment

  • Versions:

    • lottie-node: 2.0.0
    • lottie-web: 5.9.6
    • node-canvas: 2.10.1
    • jsdom: 20.0.0
    • Node.js: 14.15.1
  • Operating System: MacOS 11.1

Tried also on an Azure Function with linux and Node 12.22.11 (different version of jsdom too, 19.0.0) and reported exaxtly the same error

Full stack trace or any errors

(node:55203) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'loadAnimation' of undefined
at /Users/meo/node_modules/lottie-node/index.js:63:24
at /Users/meo/Downloads/render-snapshot.js:11:21
(Use node --trace-warnings ... to show where the warning was created)
(node:55203) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:55203) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Link to where the bug is happening

render-snapshot.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions