question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR TypeError: animejs__WEBPACK_IMPORTED_MODULE_1__ is not a function

See original GitHub issue

Describe 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:

  1. install angular (as it has TS enabled it’s the fastest way to get to it) and run ng new myProject
  2. Install animejs and the type definition (@types/animejs) using npm
  3. Use the anime function in any component (import * as anime from 'animejs';)
  4. See error

Expected behavior See animation without error.

Desktop (please complete the following information):

  • OS: OSX
  • Browser: Chrome
  • Version: Latest

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

21reactions
ashhitchcommented, May 14, 2019

I had this issue too, to fix its I had to use the following import: import anime from 'animejs/lib/anime.es';

4reactions
NOPRODcommented, May 21, 2019

#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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found