Skip to content
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

Won't compile after importing external node libraries #73

Open
dogtopus opened this issue May 5, 2023 · 3 comments
Open

Won't compile after importing external node libraries #73

dogtopus opened this issue May 5, 2023 · 3 comments

Comments

@dogtopus
Copy link

dogtopus commented May 5, 2023

Step to reproduce:

  • Clone frida-agent-example and delete the lock file
  • Run npm install @types/lodash lodash
  • Import and use lodash in index.ts
  • Run npm run build

Error:

> frida-agent-test@1.0.0 build
> frida-compile agent/index.ts -o _agent.js -c

TypeError: node.expression.getText is not a function
    at visitCallExpression (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/cjstoesm.js:1577:25)
    at visitNode (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/cjstoesm.js:2633:16)
    at file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/cjstoesm.js:2894:33
    at visitNode (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/typescript.js:85139:21)
    at visitEachChildOfParenthesizedExpression (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/typescript.js:85817:32)
    at Object.visitEachChild (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/typescript.js:85389:35)
    at Object.childContinuation (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/cjstoesm.js:2893:47)
    at visitNode (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/cjstoesm.js:2635:20)
    at file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/cjstoesm.js:2894:33
    at visitNode (file:///home/user/Documents/src/frida-agent-test/node_modules/frida-compile/ext/typescript.js:85139:21)
@bluewave41
Copy link

Provide a reproduction repo please. This does indeed work as you've described it.

@dogtopus
Copy link
Author

dogtopus commented May 6, 2023

@bluewave41 You would also need to delete the lock file and run npm install so it would pull the latest version. frida-agent-example uses an older version by default which isn't affected by this regression.

I think this was introduced in 16.2.0.

Let me know if you still have issue reproducing it.

@bluewave41
Copy link

bluewave41 commented May 6, 2023

I see it now.

If it specifically started in 16.2.0 which is most likely the case then it's going to be something in this beast of a commit: 487d028#diff-48f38ed4a20115aadfb06657d8d88c8df5c501c4f73b9f44dcce647a35435640

Submodule TypeScript updated 9959 files

Right here is where it looks to initially break down

I'd ran into this issue a couple of times and managed to fix a few of them but I don't think the issues I ran into are related to what you're trying to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants