Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

TypeError: Cannot read property 'range' of null #88

Open
Miaoxingren opened this issue Feb 5, 2020 · 2 comments
Open

TypeError: Cannot read property 'range' of null #88

Miaoxingren opened this issue Feb 5, 2020 · 2 comments

Comments

@Miaoxingren
Copy link

eslint failed at this:

const loadComp = name => import(`components/${name}/${name}.vue`)

Error log:

e:\lib_project\test-nuxt-eslint>npm run lint

> test-nuxt-eslint@1.0.0 lint e:\lib_project\test-nuxt-eslint
> eslint --ext .js,.vue --ignore-path .gitignore .

TypeError: Cannot read property 'range' of null
Occurred while linting e:\lib_project\test-nuxt-eslint\pages\index.vue:35
    at SourceCode.getTokenBefore (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\source-code\token-store\index.js:298:18)
    at checkSpacingBefore (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\rules\template-curly-spacing.js:60:42)
    at TemplateElement (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\rules\template-curly-spacing.js:119:17)
    at listeners.(anonymous function).forEach.listener (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\linter\safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\linter\node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\linter\node-event-generator.js:283:22)
    at NodeEventGenerator.enterNode (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\linter\node-event-generator.js:297:14)
    at CodePathAnalyzer.enterNode (e:\lib_project\test-nuxt-eslint\node_modules\eslint\lib\linter\code-path-analysis\code-path-analyzer.js:634:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! test-nuxt-eslint@1.0.0 lint: `eslint --ext .js,.vue --ignore-path .gitignore .`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the test-nuxt-eslint@1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

For more detail, please look at this repo: https://github.com/Miaoxingren/test-nuxt-eslint.

@clarkdo
Copy link
Member

clarkdo commented Feb 5, 2020

Should be related nuxt/nuxt#6871
Can you try babel/babel-eslint#799 (comment) as a temp fix before babel fixes this issue ?

@ghost
Copy link

ghost commented May 6, 2020

Adding the @babel/parser resolution doesn't help.

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

No branches or pull requests

2 participants