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.

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

See original GitHub issue

Hi I’m getting these errors when trying to run a fresh install.

Cesium loads for a second or two, then these errors pop up in the console, and Cesium exits.

    140:80-87 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
     @ ./node_modules/cesium/Source/Core/TaskProcessor.js
     @ ./node_modules/cesium/Source/Core/QuantizedMeshTerrainData.js
     @ ./node_modules/cesium/Source/Core/CesiumTerrainProvider.js
     @ ./node_modules/cesium/Source/Cesium.js
     @ ./src/index.js
     @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js
    
    WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js
    57:15-22 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
     @ ./node_modules/cesium/Source/Core/buildModuleUrl.js
     @ ./node_modules/cesium/Source/Cesium.js
     @ ./src/index.js
     @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js
    
    WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js
    77:77-84 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
     @ ./node_modules/cesium/Source/Core/buildModuleUrl.js
     @ ./node_modules/cesium/Source/Cesium.js
     @ ./src/index.js
     @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
ggetzcommented, Jan 15, 2018

Since Cesium has branching ways to build paths to modules, when webpack compiles it will throw these warnings, however everything is still working as expected.

Setting the following configurations will suppress the warnings:

unknownContextCritical: false,
unknownContextRegExp: /^.\/.*$/
1reaction
ggetzcommented, Jan 15, 2018

Make sure you check WebGL compatibility on your machine. I’ll close this, feel free to reopen if it is indeed the webpack configuration causing the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Critical dependency: require function is used in a way in which ...
Critical dependency : require function is used in a way in which dependencies cannot be statically extracted · Subscribe to RSS.
Read more >
Critical dependency: require function is used in a way ... - GitHub
The error originates from the esm target, which should not have any require statements. It'd be nice to explore that built module and...
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 >
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 >
Critical dependency: require function is ... - Auth0 Community
Error message : Critical dependency: require function is used in a way in which dependencies cannot be statically extracted.
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