Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

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

Open
seanadkinson opened this issue Mar 4, 2015 · 8 comments
Open

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

seanadkinson opened this issue Mar 4, 2015 · 8 comments

Comments

@seanadkinson
Copy link

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
Copy link
Author

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.

sokra added a commit that referenced this issue Mar 5, 2015
@dozoisch
Copy link

dozoisch commented Apr 1, 2015

@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.

@vihangm
Copy link

vihangm commented Jan 26, 2016

Fixed. See browserify/diffie-hellman#21

@pruett
Copy link

pruett commented Apr 28, 2016

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

@UnsungHero97
Copy link

UnsungHero97 commented May 17, 2016

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/
  ]
};

@jorawarsingh
Copy link

@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/
]

@terinjokes
Copy link
Contributor

@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.

@ghost
Copy link

ghost commented Oct 27, 2016

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants