You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this simple Vue.js project test.zip
When I run npm run build I get a crash:
Z:\1>npm run build
> composite@1.0.6 build Z:\1
> node --preserve-symlinks --preserve-symlinks-main ./node_modules/@vue/cli-serv
ice/bin/vue-cli-service.js build
- Building for production...
ERROR Failed to compile with 1 errors 17:11:23
error in ./src/App.vue
Module build failed (from ./node_modules/eslint-loader/index.js):
TypeError: Cannot read property 'range' of null
Occurred while linting Z:\1\src\App.vue:11
at SourceCode.getTokenBefore (Z:\1\node_modules\eslint\lib\source-code\token
-store\index.js:298:18)
at checkSpacingBefore (Z:\1\node_modules\eslint\lib\rules\template-curly-spa
cing.js:60:42)
at TemplateElement (Z:\1\node_modules\eslint\lib\rules\template-curly-spacin
g.js:119:17)
at Z:\1\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (Z:\1\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (Z:\1\node_modules\eslint\lib\linter\nod
e-event-generator.js:254:26)
at NodeEventGenerator.applySelectors (Z:\1\node_modules\eslint\lib\linter\no
de-event-generator.js:283:22)
at NodeEventGenerator.enterNode (Z:\1\node_modules\eslint\lib\linter\node-ev
ent-generator.js:297:14)
at CodePathAnalyzer.enterNode (Z:\1\node_modules\eslint\lib\linter\code-path
-analysis\code-path-analyzer.js:634:23)
at Z:\1\node_modules\eslint\lib\linter\linter.js:936:32
at Array.forEach (<anonymous>)
at runRules (Z:\1\node_modules\eslint\lib\linter\linter.js:931:15)
at Linter._verifyWithoutProcessors (Z:\1\node_modules\eslint\lib\linter\lint
er.js:1157:31)
at Z:\1\node_modules\eslint\lib\linter\linter.js:1281:29
at Array.map (<anonymous>)
@ ./src/main.js 5:0-28 7:17-20
@ multi ./src/main.js
ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! composite@1.0.6 build: `node --preserve-symlinks --preserve-symlinks-ma
in ./node_modules/@vue/cli-service/bin/vue-cli-service.js build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the composite@1.0.6 build script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! z:\temp\npm\_logs\2020-05-02T14_11_23_489Z-debug.log
Z:\1>
The issue occurs with the ESLint rule template-curly-spacing - only when there are no interpolations in a JavaScript string template (those contained in backticks). The token variable on line 117 in file eslint/lib/rules/template-curly-spacing.js is undefined in such cases.
I reported the issue to ESLint (eslint/eslint#13248) but they claim that the problem lies in Vue-ESLint-parser because getFirstToken(node) should never return undefined for a TemplateElement.
Any ideas ?
The text was updated successfully, but these errors were encountered:
I have checked your files. It's a babel-eslint problem. The same problem occurs with js file that have the same code.
You can either stop using babel-eslint or contact the babel-eslint repository.
I have this simple Vue.js project
test.zip
When I run
npm run build
I get a crash:The issue occurs with the ESLint rule
template-curly-spacing
- only when there are no interpolations in a JavaScript string template (those contained in backticks). Thetoken
variable on line 117 in file eslint/lib/rules/template-curly-spacing.js is undefined in such cases.I reported the issue to ESLint (eslint/eslint#13248) but they claim that the problem lies in Vue-ESLint-parser because
getFirstToken(node)
should never return undefined for aTemplateElement
.Any ideas ?
The text was updated successfully, but these errors were encountered: