browserify / pbkdf2

PBKDF2 with any supported hashing algorithm in Node
MIT License
189 stars 60 forks source link

Incompatibility with rn-nodeify #96

Open speedytec opened 3 years ago

speedytec commented 3 years ago

When i Run my postinstall script, in a previous version of pbkdf2 (3.0.8), the rn-nodeify replace the "process.version" with the current version of node
MicrosoftTeams-image (2) In the actual version the rn-nodeify brokes the code MicrosoftTeams-image (3)

calvinmetcalf commented 3 years ago

looks like rn-nodeify fixed it on their end

avinokur4 commented 3 years ago

Got the same problem here STR:

  1. rn-nodeify --install --hack --yarn
  2. react-native bundle --entry-file index.tsx --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
error SyntaxError: /Users/test/node_modules/parse-asn1/node_modules/pbkdf2/lib/default-encoding.js: Unexpected token (5:36)

  3 | if (global.process && global.process.browser) {
  4 |   defaultEncoding = 'utf-8'
> 5 | } else if (global.process && global."v15.6.0") {
    |                                     ^
  6 |   var pVersionMajor = parseInt("v15.6.0".split('.')[0].slice(1), 10)
  7 |
  8 |   defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'. Run CLI with --verbose flag for more details.
SyntaxError: /Users/test/node_modules/parse-asn1/node_modules/pbkdf2/lib/default-encoding.js: Unexpected token (5:36)

  3 | if (global.process && global.process.browser) {
  4 |   defaultEncoding = 'utf-8'
> 5 | } else if (global.process && global."v15.6.0") {
    |                                     ^
  6 |   var pVersionMajor = parseInt("v15.6.0".split('.')[0].slice(1), 10)
  7 |
  8 |   defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
WebTarantul commented 3 years ago

Same issue after node_modules/.bin/rn-nodeify --install --hack

calvinmetcalf commented 3 years ago

have you upgraded rn-nodeify ?

mkhalil49 commented 3 years ago

I fixed this by following this comment solution

https://github.com/tradle/rn-nodeify/issues/102#issuecomment-817284939