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 4.16.2 - Critical dependencies - the request of a dependency is an expression

See original GitHub issue

With Webpack 4.16.2 this import cause a critical dependencies warning: import universal from 'react-universal-component'

With Webpack 4.8.0 works fine. I suppose this is the cause:

https://github.com/webpack/webpack/releases/tag/v4.16.2 handle module.require like require

In utils.js i found a module.require.

Can you investigate about this? Thanks for your work!

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
ScriptedAlchemycommented, Sep 9, 2018

We might be able to work around it by treating as a string

‘let Module = require(${url});’

4reactions
ScriptedAlchemycommented, Sep 12, 2018

Yaaaaay!

Okay I’ll merge it tonight or tomorrow.

Heads up, there’s a React 16 rewrite on the way. It will be RUC 4 but I plan to support RUC 3 for a while ❤️

Thrilled these damn errors are gone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack - Critical dependency: the request of a dependency ...
Webpack tries to resolve require calls statically to make a minimal bundle. When a library uses variables or expressions in a require call...
Read more >
the request of a dependency is an expression - You.com
Webpack - Critical dependency: the request of a dependency is an expression - Stack Overflow. Manually configure webpack to import the required libraries...
Read more >
node.js - webpack - iTecNote
Javascript – Webpack WARNING in ./node_modules/express/lib/view.js Critical dependency: the request of a dependency is an expression.
Read more >
webpack/types.d.ts - UNPKG
The CDN for webpack. ... 466, * Is expression a runtime or compile-time value? ... 2351, dependencies: Dependency[];. 2352, blocks: AsyncDependenciesBlock ...
Read more >
Hiding Critical Dependency Warnings from webpack - Medium
You can use the Webpack's ContextReplacementPlugin to acknowledge dependency warnings that you have investigated and found safe.
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