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

Failed to parse file, transformation error #206

Open
WoZ opened this issue Jan 18, 2019 · 1 comment
Open

Failed to parse file, transformation error #206

WoZ opened this issue Jan 18, 2019 · 1 comment

Comments

@WoZ
Copy link

WoZ commented Jan 18, 2019

Hello!

I'm running code on node v10.10, with istanbul 0.4.5 and node-coveralls 3.0.2.

I use standard command:

$ NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --opts tests/mocha.opts -R spec ./tests && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage

coveralls fails on file consul-kv-monitor/src/ConsulKvMonitor.js with error

Failed to parse file: /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/src/ConsulKvMonitor.js
Transformation error; return original code
{ Error: Line 320: Unexpected identifier
    at constructError (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2407:21)
    at createError (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2426:17)
    at unexpectedTokenError (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2500:13)
    at throwUnexpectedToken (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2505:15)
    at parseClassBody (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:5147:21)
    at parseClassDeclaration (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:5169:21)
    at parseStatementListItem (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3981:24)
    at parseFunctionSourceElements (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:4869:23)
    at parseFunctionExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:5074:16)
    at parsePrimaryExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3273:24)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parseLeftHandSideExpressionAllowCall (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3414:20)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parsePostfixExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3490:16)
    at parseUnaryExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3550:20)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parseBinaryExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3639:16)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parseConditionalExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3696:16)
    at parseAssignmentExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3893:16)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parseGroupExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3162:16)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parsePrimaryExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3239:20)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parseLeftHandSideExpressionAllowCall (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3414:20)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parsePostfixExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3490:16)
    at parseUnaryExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3550:20)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parseBinaryExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3639:16)
    at inheritCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2681:18)
    at parseConditionalExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3696:16)
    at parseAssignmentExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3893:16)
    at isolateCoverGrammar (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:2663:18)
    at parseExpression (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3942:16)
    at parseExpressionStatement (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:4222:20)
    at parseStatement (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:4760:24)
    at parseStatementListItem (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:3989:16)
    at parseScriptBody (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:5490:25)
    at parseProgram (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:5506:16)
    at Object.parse (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/esprima/esprima.js:5690:23)
    at Instrumenter.instrumentSync (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/instrumenter.js:459:31)
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/hook.js:54:31
    at Object.Module._extensions.(anonymous function) [as .js] (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/hook.js:105:23)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/tests/Functional/ServiceKvMonitor.js:12:26)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.Module._extensions.(anonymous function) [as .js] (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/hook.js:109:37)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/mocha/lib/mocha.js:514:10)
    at Object.<anonymous> (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/mocha/bin/_mocha:480:18)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.Module._extensions.(anonymous function) [as .js] (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/hook.js:109:37)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at runFn (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/command/common/run-with-cover.js:122:16)
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/command/common/run-with-cover.js:251:17
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/istanbul/lib/util/file-matcher.js:68:16
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/async/lib/async.js:52:16
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/async/lib/async.js:361:13
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/async/lib/async.js:52:16
    at done (/Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/async/lib/async.js:246:17)
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/async/lib/async.js:44:16
    at /Volumes/phpstorm_volume/PhpstormProjects/consul-kv-monitor/node_modules/async/lib/async.js:358:17
    at LOOP (fs.js:1544:14)
    at process._tickCallback (internal/process/next_tick.js:61:11)
  lineNumber: 320,
  description: 'Unexpected identifier',
  index: 10468 }

Here is line 320 right from the repo:

https://github.com/LCMApps/consul-kv-monitor/blob/a5969f90dce850a7500a66372597f2099bf99c67/src/ConsulKvMonitor.js#L320

@WoZ
Copy link
Author

WoZ commented Jan 18, 2019

Found solution by myself. gotwarlost/istanbul#904

Maybe it's a good idea to specify that istanbul doesn't work with es6 right in the node-coveralls readme? If so, I can prepare PR.

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

1 participant