ERROR TypeError: animejs__WEBPACK_IMPORTED_MODULE_1__ is not a function
See original GitHub issueDescribe the bug
Using the version 3 of this library with TypeScript and WebPack, the console throws the following error:
ERROR TypeError: animejs__WEBPACK_IMPORTED_MODULE_1__ is not a function
I’m not exactly sure if the problem comes from the new version of this library, or if the type definition are outdated (@types/animejs).
To Reproduce Steps to reproduce the behavior:
- install angular (as it has TS enabled it’s the fastest way to get to it) and run
ng new myProject
- Install animejs and the type definition (
@types/animejs
) using npm - Use the anime function in any component (
import * as anime from 'animejs';
) - See error
Expected behavior See animation without error.
Desktop (please complete the following information):
- OS: OSX
- Browser: Chrome
- Version: Latest
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9 (1 by maintainers)
Top Results From Across the Web
TypeError: Webpack imported module is not a function
When execution reaches shiftService.postData, the error is thrown. I am really confused since I am basically copying some older project of mine ...
Read more >How to solve the "is not a function" error in JavaScript
js we use require() to load external modules and files. This can cause, in some cases, an error like this: TypeError: require(...) is...
Read more >Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError - Some selector is not a function - jQuery is not a function - owlCarousel...
Read more >How to fix "Uncaught TypeError: x is not a function" in JavaScript
JS Casts 01 - How to fix "Uncaught TypeError : x is not a function " in JavaScript.Visit https://javascriptcasts.com/episodes/01 for a summary ...
Read more >How to Uncaught TypeError: x is not a function - YouTube
TypeError : "x" is not a functionThe JavaScript exception "is not a function " occurs when there was an attempt to call a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
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
I had this issue too, to fix its I had to use the following import:
import anime from 'animejs/lib/anime.es';
#527 npm i animejs npm i @types/animejs import anime from ‘animejs/lib/anime.es’;
use directly anime, work fine on angular 7 @ashhitch +1