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

Unknown unexpected token error

Open vrocky opened this issue 4 years ago • 1 comments

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: }

vrocky avatar Mar 29 '21 15:03 vrocky

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)

jinjinwa avatar Mar 22 '24 02:03 jinjinwa