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

Cannot read property range of null #120

Closed
ospfranco opened this issue Jul 28, 2020 · 1 comment
Closed

Cannot read property range of null #120

ospfranco opened this issue Jul 28, 2020 · 1 comment

Comments

@ospfranco
Copy link

What version of this package are you using?
I was using some old versions this morning but I just bumped them and I'm still having the same issues

"standard": "14.3.4"
"eslint": "^7.5.0",

What operating system, Node.js, and npm version?
macOS, Node 12, yarn

What happened?
I opened my workspace this morning, typed a few things and all of the sudden I have permanent errors that won't go away

TypeError: Cannot read property 'range' of null
Occurred while linting /Users/osp/dev/BodyFast/file:/Users/osp/dev/BodyFast/src/Components/FastingPhases.js:258
    at SourceCode.getTokenBefore (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/source-code/token-store/index.js:298:18)
    at checkSpacingBefore (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/rules/template-curly-spacing.js:60:42)
    at TemplateElement (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/rules/template-curly-spacing.js:119:17)
    at /Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/linter/node-event-generator.js:283:22)
    at NodeEventGenerator.enterNode (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/linter/node-event-generator.js:297:14)
    at CodePathAnalyzer.enterNode (/Users/osp/dev/BodyFast/node_modules/standard/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:634:23) {
  currentNode: Node {
    type: 'TemplateElement',
    start: 8162,
    end: 8162,
    loc: SourceLocation { start: [Position], end: [Position] },
    range: [ 8162, 8162 ],
    value: { raw: '', cooked: '' },
    tail: false,
    parent: Node {
      type: 'TemplateLiteral',
      start: 8161,
      end: 8181,
      loc: [SourceLocation],
      range: [Array],
      expressions: [Array],
      quasis: [Array],
      parent: [Node]
    }
  }
}

The only way to get rid of the parsing errors it to restart vscode (or reload it via command palette), then it works again for a little while, but when I add some text it crashes again

Are you willing to submit a pull request to fix this bug?
No

@ospfranco
Copy link
Author

this comment babel/babel-eslint#530 (comment) on this massive thread seems to have fixed my issue for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants