-
Notifications
You must be signed in to change notification settings - Fork 101
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
TypeError: Cannot read property 'transformFile' of undefined #16
Comments
Alright, I got slightly further with a different repo that I found that used this library. I needed to add these lines of code to the getMetroTransformer.js file: const metroVersion = semver(require('metro/package.json').version).minor;
if (metroVersion >= 51) {
return require('metro-react-native-babel-transformer/src/index');
} And of course have the metro-react-native-babel-transformer installed, as well as having this .babelrc file: {
"presets": ["module:metro-react-native-babel-preset"]
} It seems to work (Tried react-native v0.59.10 and v0.61.1 currently), but minification happens on the bundle, after obfuscating, which I think is the reason that the output is basically the same, if I obfuscate or not. Btw. these are the dependencies: "dependencies": {
"react": "16.8.3",
"react-native": "0.61.1"
},
"devDependencies": {
"babel-core": "6.26.0",
"metro-react-native-babel-preset": "0.56.0",
"react-native-obfuscating-transformer": "^1.0.0-rc.0"
} I get this in the log when I run the ./gradlew assembleRelease
Which should mean it actually obfuscates the code, unfortunately it is not shown in the output bundle itself. Also the selfDefending option breaks the app, I assume because of the above reason - minifying the output changes the code, and thus breaks the selfDefending code. Any way to keep the obfuscated code, while bundling it? |
I have the same issue, did you managed to solve it? |
same here |
Can every one give me the solution? |
I find the solution when using with react-native 0.61
|
yes this issue has been resolved from this Solution. |
npm i babylon --save-dev |
Versions:
"react-native": "0.59.10",
"react-native-obfuscating-transformer": "^1.0.0",
Files:
metro.config.js:
transformer.js:
Error I am getting:
Repo
Simplest repo I could make that reproduces this error:
https://github.com/ExoMemphiz/ObfuscationTest/
The text was updated successfully, but these errors were encountered: