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

crash with empty cache files #673

Closed
alvaropinot opened this issue Nov 2, 2016 · 4 comments

Comments

@alvaropinot
Copy link

commented Nov 2, 2016

Suddenly standard started giving the attached below output. After spending some time searching through my code and reducing it to 0 files I was still getting the same error. Later I've found that there is no try/catch trying to parse back the JSON from the cache files found at .standard-cache, so when the file is empty it crashes. The problem seems to be at flat-cache package or its usage, but I thought you may know more about it. I'll try to take a deeper look, anyway.

What do you think about trying to delete cache files when this kind of error occurs?

Hope I can help in any manner :)

standard: Unexpected linter output:

SyntaxError: Unexpected end of JSON input
    at Object.parse (native)
    at Object.parseRecursion [as parse] (.../node_modules/circular-json/build/circular-json.node.js:182:15)
    at module.exports.readJSON (.../node_modules/flat-cache/utils.js:15:25)
    at Object.cache.load (.../node_modules/flat-cache/cache.js:25:23)
    at Object.module.exports.create (.../node_modules/flat-cache/cache.js:158:9)
    at Object.module.exports.load (.../node_modules/flat-cache/cache.js:144:17)
    at Object.module.exports.create (.../node_modules/file-entry-cache/cache.js:13:27)
    at new CLIEngine (.../node_modules/eslint/lib/cli-engine.js:463:38)
    at .../node_modules/standard-engine/index.js:107:16
    at .../node_modules/deglob/index.js:51:12

If you think this is a bug in `standard`, open an issue: https://github.com/feross/standard/issues
@vzqzac

This comment has been minimized.

Copy link

commented Dec 9, 2016

I have the same issue, I came across it by adding a random line just to keep standard checking all files, but yes, I also think is an issue

@feross

This comment has been minimized.

Copy link
Member

commented Dec 12, 2016

Thanks for the report. This looks like an ESLint issue, so I've re-opened it on the ESLint issue tracker. eslint/eslint#7748

@alvaropinot I really appreciate you sharing the stack trace. We got another report of this error before, but it didn't have enough detail to pin it down. Thanks!

@alvaropinot

This comment has been minimized.

Copy link
Author

commented Dec 18, 2016

@feross thank you for taking a look into this :) If you need any help just let me know :D

@feross

This comment has been minimized.

Copy link
Member

commented Dec 24, 2016

This issue was fixed in ESLint, so you shouldn't experience it anymore.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.