tradle/rn-nodeify

bug: pbkdf2 Unexpected token

adeyahya opened this issue ยท 2 comments

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch rn-nodeify@10.2.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/rn-nodeify/pkg-hacks.js b/node_modules/rn-nodeify/pkg-hacks.js
index 25f4dbd..bca6d35 100644
--- a/node_modules/rn-nodeify/pkg-hacks.js
+++ b/node_modules/rn-nodeify/pkg-hacks.js
@@ -520,7 +520,7 @@ var hackers = [
     hack: function (file, contents) {
       if (isInReactNative(file)) return
 
-      var fixed = contents.replace('process.version', '"' + process.version + '"')
+      var fixed = contents.replace(/\.+process\.version/g, '["' + process.version + '"]')
 
       return contents === fixed ? null : fixed
     }

This issue body was partially generated by patch-package.

@adeyahya what version of pbkdf2 are you using?

add this one to your package.json

"resolutions": { "**/pbkdf2": "3.1.1", "**/**/pbkdf2": "3.1.1", "**/**/**/pbkdf2": "3.1.1" },