react-native-decompiler icon indicating copy to clipboard operation
react-native-decompiler copied to clipboard

Cannot read property '<X>' of undefined

Open ronytesler opened this issue 4 years ago • 3 comments

I ran: ts-node ./src/main.ts -i c:\test\smali\assets\index.android.bundle -o ./output got errors like: Reading file... Parsing JS... Finding modules... Took 103757.12750002742ms Pre-parsing modules... ████████████████████████████████████████ 100% | ETA: 0s | 6279/6279 Took 30503.019600003958ms Tagging... ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | ETA: 12889s | 1/6279 Took 2057.680599987507ms Filtering out modules only depended on ignored modules... 5784 remain to be decompiled Took 37001.79580000043ms Decompiling... ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | ETA: 0s | 0/5784An error occured parsing module 132, it will be outputted as is! TypeError: Cannot read property 'scope' of undefined at DefaultInteropEvaluator.bindingTraverse (C:\react-native-decompiler\src\plugin.ts:144:13) at VariableDeclarator (C:\react-native-decompiler\src\decompilers\evaluators\defaultInteropEvaluator.ts:38:16) at C:\react-native-decompiler\src\router.ts:148:29 at Array.forEach () at C:\react-native-decompiler\src\router.ts:148:13 at NodePath._call (C:\react-native-decompiler\node_modules@babel\traverse\lib\path\context.js:55:20) at NodePath.call (C:\react-native-decompiler\node_modules@babel\traverse\lib\path\context.js:42:17) at NodePath.visit (C:\react-native-decompiler\node_modules@babel\traverse\lib\path\context.js:92:31) at TraversalContext.visitQueue (C:\react-native-decompiler\node_modules@babel\traverse\lib\context.js:115:16) at TraversalContext.visitMultiple (C:\react-native-decompiler\node_modules@babel\traverse\lib\context.js:79:17)

ronytesler avatar Nov 27 '21 15:11 ronytesler

Also this: TypeError: Property expression of JSXExpressionContainer expected node to be of a type ["Expression","JSXEmptyExpression"] but instead got "JSXExpressionContainer"

ronytesler avatar Nov 27 '21 15:11 ronytesler

Also this: TypeError: Property expression of JSXExpressionContainer expected node to be of a type ["Expression","JSXEmptyExpression"] but instead got "JSXExpressionContainer"

Same issue here: any update or comment about it?

This seems related, but I'm not sure what changes have to be done here in this repo or what kind of workaround could alleviate the issue.

Thanks

giuliohome avatar Jan 14 '22 10:01 giuliohome

Aside from a spread object or similar things (see the pull request related to the issue linked in my above comment in babel-plugin-styled-components), another doubt I have is that a JSXExpressionContainer wrapped inside itself could be a misinterpratation of a string interpolation, e.g. in a translation i18next resource like in the example linked here, that I also report below:

export const TRANSLATIONS_EN = {
 welcome:"Welcome to the tutorial",
 date_format_one: "{{-date, YYYY/MM/DD}}",
 date_format_two: "{{date, DD-MM-YYYY}}",
};

giuliohome avatar Jan 14 '22 14:01 giuliohome