You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error while transforming with RN 0.64 and Typescript #43
Just updated to new React Native version and it's broken again.
Output:
error app/sampleFile.ts: function (prevType) {
this.state.exprAllowed = false;
if (prevType === types._let || prevType === types._c...<omitted>...
} could not be cloned.
Error: function (prevType) {
this.state.exprAllowed = false;
if (prevType === types._let || prevType === types._c...<omitted>...
} could not be cloned.
at Object.serialize (v8.js:202:7)
at _default (/home/sample/app/node_modules/metro-transform-worker/node_modules/@babel/core/lib/transformation/util/clone-deep.js:18:30)
at normalizeFile (/home/sample/app/node_modules/metro-transform-worker/node_modules/@babel/core/lib/transformation/normalize-file.js:52:36)
at normalizeFile.next (<anonymous>)
at run (/home/sample/app/node_modules/metro-transform-worker/node_modules/@babel/core/lib/transformation/index.js:31:50)
at run.next (<anonymous>)
at /home/sample/app/node_modules/metro-transform-worker/node_modules/@babel/core/lib/transform-ast.js:20:41
at Generator.next (<anonymous>)
at evaluateSync (/home/sample/app/node_modules/gensync/index.js:251:28)
Already updated my fork appropriately and it works with updated dependencies (+ necessary code changes). PR will be created soon.
Unfortunately not. You will have to include it manually if you want to use it. I guess with our next release we will drop this dependency as well and will check out the solution of directly use javascript-obfuscator.
We've got Hermes enabled (this should generate bytecode rather than JS) but we still have the JS files that need obfuscating... this may be already the solution even for others. I guess our configuration is just not completed yet.
I ended up publishing your fork to a private npm registry and it works well alongside Hermes. A solution using javascript-obfuscator directly would be interesting.
Activity
geraintwhite commentedon Jul 20, 2021
@mppperez is your fork available on npm?
mppperez commentedon Aug 12, 2021
Unfortunately not. You will have to include it manually if you want to use it. I guess with our next release we will drop this dependency as well and will check out the solution of directly use javascript-obfuscator.
We've got Hermes enabled (this should generate bytecode rather than JS) but we still have the JS files that need obfuscating... this may be already the solution even for others. I guess our configuration is just not completed yet.
geraintwhite commentedon Aug 12, 2021
I ended up publishing your fork to a private npm registry and it works well alongside Hermes. A solution using
javascript-obfuscatordirectly would be interesting.AlbertoMeQ commentedon Mar 28, 2023
@mppperez @grit96 How did you manage to get hermes working with the obfuscator?
Either I obfuscate or I use hermes, I cannot get both to work.
More specifically, the obfuscator seems to work but then hermes recreates its own android.bundle without the obfuscation.
When I disassemble the bundle I get all the original code back. Any tips?☹️
geraintwhite commentedon Mar 29, 2023
This is now the recommended way to do it:
AlbertoMeQ commentedon Mar 29, 2023
@grit96 Thanks! I will try. One question: is it possible to plug in the javascript obfuscator there?
AlbertoMeQ commentedon Mar 29, 2023
As an update, that still doesn't seem to minify my bundle. I am using hermes and this command to make a build:
But the
index.android.bundleis still not obfuscated (I still get lots of "Original Name: xxx" which contains the original function names.)Thoughts?
I have a feeling something is undoing the obfuscation step.
geroale commentedon Dec 23, 2024
Same issue here