node-libs-browser icon indicating copy to clipboard operation
node-libs-browser copied to clipboard

0.4.2: diffie-hellman cannot find ./lib/primes

Open seanadkinson opened this issue 9 years ago • 8 comments

Hello,

Looks like the update from a couple hours ago could be bringing in a bug with a downstream dependency.

Dependencies go:

  • webpack 1.5.1 depends on node-libs-browser ~0.4.0
  • node-libs-browser 0.4.2 depends on crypto-browserify ^3.9.13
  • crypto-browserify 3.9.13 depends on diffie-hellman ^3.0.1
  • diffie-hellman 3.0.1 breaks

Error in browser is: Cannot find module "./lib/primes", which is required from diffie-hellman/browser.js

Looks like there exists a ./lib/primes.json in that package, so maybe configuring webpack to auto check ".json" suffixes would work, I'll try that.

Will also learn about npm-shrinkwrap after this.

Any other tips for resolving issue? Thank you.

seanadkinson avatar Mar 04 '15 23:03 seanadkinson

To downgrade and workaround temporarily (for anyone else that finds this thread and has the same issue:

npm install --save [email protected]
rm -Rf node_modules/webpack
npm install

This will add an explicit dependency in your package.json for [email protected], so be sure to remove in that future when this issue is resolved.

seanadkinson avatar Mar 04 '15 23:03 seanadkinson

@sokra This was kind of unexpected from upgrading my old webpack version! (1.5.3)... Everything that I have that relied on that crypto shim is now broken. The version there doesn't have any AES function implemented!

Adding an explicit dep to my package.json for [email protected] fixed it.

dozoisch avatar Apr 01 '15 22:04 dozoisch

Fixed. See https://github.com/crypto-browserify/diffie-hellman/pull/21

vihangm avatar Jan 26 '16 18:01 vihangm

I receive this same error using v2.1.0-beta6. has this been fixed?

pruett avatar Apr 28 '16 18:04 pruett

still broken in [email protected]. my workaround for the moment is adding the json-loader:

const JSON_LOADER = {
  loader: 'json',
  test: /\.json$/,
  include: [
    /node_modules/
  ]
};

UnsungHero97 avatar May 17 '16 18:05 UnsungHero97

@UnsungHero97 this work well just want to point that by defualt node_modules are included so you don't need to add include: [ /node_modules/ ]

jorawarsingh avatar Jul 09 '16 13:07 jorawarsingh

@UnsungHero97 The version of node-libs-browser used by Webpack 2 was updated back in January (unfortunately, the v1 branch still hasn't upgraded). In any case, by the time 2.1.0-beta.7 was released the version of crypto-browserify should have had the fixes need for diffie-hellman.

If you're still having the problem, can you give the "crypto-browserify" portion of the tree output from npm ls? I'd really like to hunt it down and resolve it.

terinjokes avatar Aug 16 '16 00:08 terinjokes

@terinjokes thats my output for npm ls crypto-browserify:

/var/www/html/filecloudprod └─┬ [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └ [email protected] └─┬ [email protected] (git://github.com/jeroennoten/webpack-stream.git#d78a3568e259f9cdbc64c60290639af6ef6d3baf) └─┬ [email protected] └─┬ [email protected] └── [email protected]

I still get the error, but working with laravel 5.3. Look at my post at stackoverflow.

ilarioengler avatar Oct 27 '16 14:10 ilarioengler