'canvas.getContext is not a function' error occured when i use lottie
See original GitHub issueDescribe the bug
‘canvas.getContext is not a function’ error occured when i use lottie

Reproduction
https://github.com/histoire-dev/histoire/compare/main...kyumoon:histoire:main
System Info
System:
OS: macOS 12.3
CPU: (10) arm64 Apple M1 Pro
Memory: 242.02 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.16.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Browsers:
Chrome: 104.0.5112.79
Safari: 15.4
Safari Technology Preview: 15.4
npmPackages:
@histoire/plugin-vue: workspace:* => 0.9.6
@vitejs/plugin-vue: ^3.0.1 => 3.0.1
histoire: workspace:* => 0.9.6
vite: ^3.0.5 => 3.0.5
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeError: getContext is not a function in JavaScript | bobbyhadz
The "getContext is not a function" error occurs when the getContext() method is called on a value that is not a canvas DOM...
Read more >getContext is not a function - Stack Overflow
This error happens when the element you asked to run getContext function for isn't true defined canvas or isn't canvas at all so...
Read more >Mock canvas element when prerendering [getContext is not a ...
Current behavior: When using the --prerender flag, the prerender will fail when using getContext() on a canvas element. canvas is not mocked in ......
Read more >How To Fix Canvas.getContext Is Not A Function Javascript ...
1. How To Debug & Fix The Canvas.getContext Is Not A Function Javascript Error. Open the Html file in a web browser such...
Read more >ngx-lottie - npm
Also, this known issue is in the lottie-web library itself. Library consumers have been trying to resolve that issue using different solutions.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Works like a charm! Thanks!
See: https://github.com/histoire-dev/histoire/blob/e3cd92a034ad5557d130f2c612d8ad4257892ca1/examples/vue3/src/components/LottieAnimation.story.vue#L6