Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues after 3.0.11 update #64

Closed
jdsirota opened this issue May 11, 2017 · 15 comments
Closed

Issues after 3.0.11 update #64

jdsirota opened this issue May 11, 2017 · 15 comments

Comments

@jdsirota
Copy link

I have the following section of code in my program, which was working before the update:

var crypto = require('crypto') /* istanbul ignore next */ if (crypto.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) { throw new Error('Unsupported crypto version') }

After updating 3.0.11, pbkdf2Sync is undefined and so my code is failing. Any information on why this may be happening would be greatly appreciated.

@argshook
Copy link

hi, you can check #60

@Incanus3
Copy link

same issue, tried with 3.0.10 and that's broken as well.

@alirussell
Copy link

@Incanus3 i managed to get it working by forcing 3.0.9

@Incanus3
Copy link

So did I, after I finally found the source of the problem. At least this will force me to use yarn instead of npm. If I had yarn.lock, I could've found it much sooner.

@danbrianwhite
Copy link

The update to add this check completely breaks Webpack since it ultimately utilizes this package for crypto.

@calvinmetcalf
Copy link
Contributor

shoulf be fixed

@danbrianwhite
Copy link

danbrianwhite commented May 11, 2017

Not fixed. The problem is the core functionality in Webpack depends on this code not throwing an error. When the crypto.pbkdf2Sync value is undefined Webpack was OK with that especially if you did not really need to use the pbkdf2 method. Now what happens is there is an error thrown by the browser because crypto.pbkdf2Sync is actually undefined when using Webpack. Even if that did not error out, when the updated code throws an error, the code still breaks running Webpack bundles.

@calvinmetcalf
Copy link
Contributor

@danbrianwhite are you getting an error in version 3.0.12 and if so what is it?

@danbrianwhite
Copy link

@calvinmetcalf when crypto is required, it does not have the key pbkdf2Sync. This key is undefined which throws a JS error because the value is undefined. Even if that undefined value is checked for, it will still break Webpack because it expects not to be thrown and the code will now be thrown because of this commit

@calvinmetcalf
Copy link
Contributor

what exactly is your config, that file shouldn't even be loaded in the first place because of the browser field in the package.json

@calvinmetcalf
Copy link
Contributor

that's what #62 fixed

@danbrianwhite
Copy link

@calvinmetcalf Thank you for following up with me. The issue is indeed fixed now with v 3.0.12 - it looks like it took a little time to propagate through my cache. Thank you for fixing the issue.

@dcousens
Copy link
Member

@calvinmetcalf seems like you had fun overnight.
Everything looks good now?

Anything published/unpublished?

@calvinmetcalf
Copy link
Contributor

I believe it's all fine now

@calvinmetcalf
Copy link
Contributor

basically I forgot to update browser object so it was pointing at the wrong file

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

No branches or pull requests

7 participants