lottie-player: Webpack warning "dependencies cannot be statically extracted"

Webpack 3.12.0 shows a warning:

warning  in ./node_modules/@lottiefiles/lottie-player/dist/lottie-player.js

1:263-264 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 19 (3 by maintainers)

Most upvoted comments

Same issue here.

WARNING in ./node_modules/@lottiefiles/lottie-player/dist/lottie-player.js 1:292-296
Critical dependency: the request of a dependency is an expression

Just installed the latest package, warning still occurring

I’ve managed to get around (or rather ignore) this warning by adding it to the Webpack 3 externals, shown here:

...
externals: [{ '@lottiefiles/lottie-player': '@lottiefiles/lottie-player' }],
...

More info about externals on the Webpack docs.