browserify icon indicating copy to clipboard operation
browserify copied to clipboard

crypto no longer works

Open pdparchitect opened this issue 9 years ago • 10 comments

It looks like something broke crypto with changes pushed today. Did not investigate where the change came from so I am reporting it here.

To reproduce:

var crypto = require('crypto')

This will produce the following error:

index.js:3 Uncaught TypeError: Cannot read property 'toString' of undefined
    at Object.require.270.crypto (index.js:3)
    at s (_prelude.js:1)
    at _prelude.js:1
    at Object.require.164.browserify-cipher (index.js:12)
    at s (_prelude.js:1)
    at _prelude.js:1
    at Object.require.1.../../src/example (index.js:7)
    at s (_prelude.js:1)
    at e (_prelude.js:1)
    at _prelude.js:1

where:

crypto.pbkdf2Sync.toString()

will is called on undefined object, i.e. crypto.pbkdf2Sync is not defined.

Again, this regression is relatively new. Perhaps due to a change from today.

pdparchitect avatar May 11 '17 17:05 pdparchitect

Facing the same issue in crypto.pbkdf2Sync.toString()

vivek0tiwari avatar May 11 '17 18:05 vivek0tiwari

There are no changes that were pushed today. Must be a dependency that pushed changes that is breaking this. crypto-browserify was my first thought, but that doesn't seem to have been updated either https://github.com/crypto-browserify/crypto-browserify. Maybe it's a dependency of crypto-browserify?

JustinBeaudry avatar May 11 '17 18:05 JustinBeaudry

Looking at https://github.com/crypto-browserify/createHash as a likely candidate for the regression.

JustinBeaudry avatar May 11 '17 19:05 JustinBeaudry

Issue is fixed in the new version of pbkdf2(3.0.12)

vivek0tiwari avatar May 11 '17 19:05 vivek0tiwari

I was just going down that rabbit hole, thanks for the reply!

JustinBeaudry avatar May 11 '17 19:05 JustinBeaudry

@vivek0tiwari Confirmed the issue is now resolved. @pdparchitect try renpm iing browserify.

JustinBeaudry avatar May 11 '17 19:05 JustinBeaudry

Yes fixed!

pdparchitect avatar May 11 '17 20:05 pdparchitect

I'm still seeing this when I do import crypto from 'crypto'.

cbartondock avatar Jun 02 '17 18:06 cbartondock

also still see the same error here..

lvcmenezes avatar Jun 03 '17 18:06 lvcmenezes

Same for me...

fryck avatar Jun 22 '17 09:06 fryck