javascript-obfuscator / javascript-obfuscator/react-native-obfuscating-transformer

Error while transforming with RN 0.64 and Typescript

Open
#43 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
211
Forks
102
PR merge metrics
No merged PRs in 30d

Description

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......
} could not be cloned.
Error: function (prevType) {
this.state.exprAllowed = false;

if (prevType === types._let || prevType === types._c......
} 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 ()
at run (/home/sample/app/node_modules/metro-transform-worker/node_modules/@babel/core/lib/transformation/index.js:31:50)
at run.next ()
at /home/sample/app/node_modules/metro-transform-worker/node_modules/@babel/core/lib/transform-ast.js:20:41
at Generator.next ()
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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the transformation of app/sampleFile.ts with React Native 0.64 and inspect the stack trace through metro-transform-worker and @babel/core/lib/transformation/clone-deep.js. Compare the updated dependencies and code changes mentioned in the issue, then confirm that the TypeScript file transforms successfully without the cloning error.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, react-native, typescript
Domain
build-system, mobile, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.