Closed Julian closed 6 years ago
hi @Julian can you provide a bit more context? not really clear from this output what was the command you were trying to execute. Can you provide a github repo with a minimum repro case?
Hey @royriojas will assemble one, thanks for the response!
@royriojas done: https://github.com/Julian/some-repo + npm run build
(Which I got by running vue init webpack some-repo
and then just deleting babel-eslint
from the package.json
and running npm install
)
Thanks @Julian, will give it a try later today.
Hey, I was able to reproduce the same bug by giving eslint the flag --report-unused-disable-directives
and having one or more non-required disable comments.
@royriojas I was able to reproduce this issue in the same way as @blacksun1. When there is at least one unused // eslint-disable
comment in the code and --report-unused-disable-directives
is present, message.source
is set to null.
So what is the recommended solution for this issue? I'm suddenly running into this and don't really know how to fix it.
Following up on my request, I've been able to get the project working with this: In the .eslintrc.js file, I changed
parserOptions: { parser: 'babel-eslint' },
to
parserOptions: { // parser: 'babel-eslint' },
Which seems to do the trick.
It is really weird as I was not able to reproduce the issue locally. But @exbinary has made a fix for this and will just publish a new version since tests pass with his change. Hope this helps to alleviate this issue.
closing as we've published v4.0.1
Apologies if this is in the wrong place, I'm not a JS dev.
I think there's an assumption that
message.source
isundefined
or an object with alength
, but that doesn't appear to be the case. I was getting the below traceback, which, after inserting aconsole.log
, showed me thatmessage
was the object at the top:⠸ building for production...{ filePath: 'src/main.js', ruleId: null, fatal: true, severity: 2, source: null, message: 'Parsing error: Cannot find module \'babel-eslint\'' } Hash: de4abf6558c690e13510 Version: webpack 3.10.0 Time: 1054ms Asset Size Chunks Chunk Names static/js/app.ac5f7a1782f171a9b60d.js 699 bytes 0 [emitted] app static/js/manifest.98e4b6563f239cfa083a.js 1.46 kB 1 [emitted] manifest static/js/app.ac5f7a1782f171a9b60d.js.map 1.07 kB 0 [emitted] app static/js/manifest.98e4b6563f239cfa083a.js.map 14.2 kB 1 [emitted] manifest index.html 352 bytes [emitted]
ERROR in ./src/main.js Module build failed: TypeError: Cannot read property 'length' of null at /Users/Julian/Development/Great/frontend/node_modules/eslint-friendly-formatter/index.js:185:74 at Array.reduce ()
at Object.module.exports [as formatter] (/Users/Julian/Development/Great/frontend/node_modules/eslint-friendly-formatter/index.js:160:17)
at printLinterOutput (/Users/Julian/Development/Great/frontend/node_modules/eslint-loader/index.js:79:29)
at Object.module.exports (/Users/Julian/Development/Great/frontend/node_modules/eslint-loader/index.js:213:3)
Build failed with errors.