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

Unknown unexpected token error #54

Open
vrocky opened this issue Mar 29, 2021 · 1 comment
Open

Unknown unexpected token error #54

vrocky opened this issue Mar 29, 2021 · 1 comment

Comments

@vrocky
Copy link

vrocky commented Mar 29, 2021

Warning: Esprima failed to parse [some-path-to-js]
Error: Line 62: Unexpected token ...

The js file contains these lines and there is no bug in the target project:

60: let isIgnored = () => false;
61: if (opts.ignore) {
62: const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
63: isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
64: }

@jinjinwa
Copy link

js-callgraph --cg ./eventHandles.js

Warning: Esprima failed to parse /Users/superman/z-trip/app-common/src/views/home2/RecentItinerary/eventHandles.js
Error: Line 56: Unexpected token .
at ErrorHandler.constructError (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:5012:22)
at ErrorHandler.createError (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:5028:27)
at Parser.unexpectedTokenError (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:1985:39)
at Parser.throwUnexpectedToken (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:1995:21)
at Parser.parsePrimaryExpression (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:2366:38)
at JSXParser.parsePrimaryExpression (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:466:97)
at Parser.inheritCoverGrammar (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:2285:37)
at Parser.parseLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:2899:26)
at Parser.inheritCoverGrammar (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:2285:37)
at Parser.parseUpdateExpression (/usr/local/lib/node_modules/@persper/js-callgraph/node_modules/esprima/dist/esprima.js:3004:26)

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