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.

Frustrating warnings when used with webpack

See original GitHub issue
WARNING in ./~/harmony/~/formidable/lib/incoming_form.js
Critical dependencies:
1:43-50 require function is used in a way, in which dependencies cannot be statically extracted
 @ ./~/harmony/~/formidable/lib/incoming_form.js 1:43-50

WARNING in ./~/harmony/~/formidable/lib/incoming_form.js
Critical dependencies:
1:0-14 the request of a dependency is an expression
 @ ./~/harmony/~/formidable/lib/incoming_form.js 1:0-14

WARNING in ./~/harmony/~/formidable/lib/file.js
Critical dependencies:
1:43-50 require function is used in a way, in which dependencies cannot be statically extracted
 @ ./~/harmony/~/formidable/lib/file.js 1:43-50

WARNING in ./~/harmony/~/formidable/lib/file.js
Critical dependencies:
1:0-14 the request of a dependency is an expression
 @ ./~/harmony/~/formidable/lib/file.js 1:0-14

WARNING in ./~/harmony/~/formidable/lib/querystring_parser.js
Critical dependencies:
1:43-50 require function is used in a way, in which dependencies cannot be statically extracted
 @ ./~/harmony/~/formidable/lib/querystring_parser.js 1:43-50

WARNING in ./~/harmony/~/formidable/lib/querystring_parser.js
Critical dependencies:
1:0-14 the request of a dependency is an expression
 @ ./~/harmony/~/formidable/lib/querystring_parser.js 1:0-14

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:30
  • Comments:52 (19 by maintainers)

github_iconTop GitHub Comments

166reactions
tdeheurlescommented, Nov 3, 2015

For webpack user, adding :

plugins: [
     new webpack.DefinePlugin({ "global.GENTLY": false })
],

fix the issue.

35reactions
benjiecommented, Dec 2, 2016

Apologies for polluting the thread, but for anyone landing on this and still having issues afterwards who happens to be using superagent, note they have a wiki page saying what to do

[…] you can either use superagent’s browser version directly (require('superagent/lib/client')), or fix your Webpack settings:

Add:

plugins.push(new webpack.DefinePlugin({ "global.GENTLY": false }));

and

node: {
  __dirname: true,
}

I also added the following, for good measure:

    alias: {
      'inherits': 'inherits/inherits_browser.js',
      'superagent': 'superagent/lib/client',
      'emitter': 'component-emitter',
    },

This cost me more time than I’d like to admit (oh look at that, it’s just gone midnight), so posting here in the hopes it helps someone else since I landed on this page early on in my search…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >
Tree Shaking - webpack
Tree shaking is a term commonly used in the JavaScript context for dead-code ... In a 100% ESM module world, identifying side effects...
Read more >
Warning when trying to require a module which is not installed ...
It seems like this is a common issue in webpack. According to the configuration docs, you can use the flag module: { exprContextCritical: ......
Read more >
ESLint warnings in webpack output are not navigable in NPM ...
ESLint warnings in webpack output are not navigable in NPM console ... Are there any workarounds for the issue? I also find this...
Read more >
An in-depth guide to performance optimization with webpack
Module bundlers are built by brilliant people just to help you with these difficult tasks. In addition, I recommend using a starter kit...
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