decode-js icon indicating copy to clipboard operation
decode-js copied to clipboard

Cannot parse code: InvalidOrUnexpectedToken

Open GithubRookieZ opened this issue 1 year ago • 1 comments
trafficstars

I want to anti-obfuscate a JS file, but prompt that the error is Cannot parse code: InvalidOrUnexpectedToken. How can I solve this situation?

微信图片_20240512100508

GithubRookieZ avatar May 12 '24 02:05 GithubRookieZ

This message indicates that the @babel/parser plugin cannot process your file correctly, and it throws the InvalidOrUnexpectedToken error:

https://github.com/babel/babel/blob/1199e6aca1df0db81074cc99fa3f89a54f02810d/packages/babel-parser/src/tokenizer/index.ts#L1051-L1057

The possible reason is that the file was edited accidentally, e.g., the insertion of extra characters. The @babel/parser cannot process a code block that is unable to run properly.

echo094 avatar May 12 '24 02:05 echo094

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

github-actions[bot] avatar Jul 11 '24 23:07 github-actions[bot]