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.

Webpack: "require function is used in a way in which dependencies cannot be statically extracted"

See original GitHub issue
[X] Bug

CountUp.js version: v2.0.0

Description

  • Building the application with webpack, I get the following warning in the output logs: WARNING in ./node_modules/countUp.js/dist/countUp.min.js 1:328-335 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
hraboviyvadimcommented, Feb 28, 2019

@CPelletier I got this error from ESLint and fixed it after adding ignore rule for whole file. But after install version 2.0.1 it just works good without any errors

1reaction
inorganikcommented, Feb 26, 2019

In that case I would like to change the module wrapping to AMD and cut another release. Although we know commonjs works well with webpack, it’s a node module wrapper and not optimized for browser usage… I was not able to use it in my demo with just requirejs. I’m sure if I googled and troubleshooted long enough I’d eventually figure out a way but it shouldn’t be that hard for everyone else. AMD works well with just requirejs; in fact requirejs recommends AMD. So if it’s compatible with webpack lets go with AMD. I’ll close after I release with AMD.

Read more comments on GitHub >

github_iconTop Results From Across the Web

require function is used in a way in which dependencies ...
25:24-31 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted.
Read more >
Critical dependency: require function is used in a way in which ...
I got this error and found this: https://fluin.io/blog/critical-dependency-cannot-be-statically-extracted, where the author shows he was ...
Read more >
HELP! WebPack Weirdness: "require function is used in a way ...
HELP! WebPack Weirdness: "require function is used in a way in which dependencies cannot be statically extracted".
Read more >
Node.js – WARNING in Critical dependency: require function ...
Node.js – WARNING in Critical dependency: require function is used in a way in which dependencies cannot be statically extracted. angularnode.jswebpack.
Read more >
Incompatible with Webpack - Google Groups
"require function is used in a way, in which dependencies cannot be statically extracted" These errors come when trying to "require" specific modules, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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