-
Notifications
You must be signed in to change notification settings - Fork 515
v3.0.3 throws "Cannot read property 'replace' of undefined" #2219
Comments
I thought we fixed this one @mdevils? |
I have the same issue in react-starter-kit after upgrading to |
|
@hzoo I though so Will take a look soon |
This has been happening for me for any version in the I went through my codebase and ran This is valid ES6 and has been addressed before. I created a very minimal test case so you can duplicate the error: export function myFunction ({ foo = false, bar = null } = {}) {
console.log(foo, bar);
} See here: |
still happening in 3.0.3 |
I have same problem use with react |
Same error for static property definition (in jscs 3.0.3) class Bar {
static test = {
foo: 'bar'
};
} That seems to be valid code.
|
I got the same error when using esnext bind expression, which doesn't seem to be supported in cst used by jscs 3.0. Whenever there is a parse error (error.rule === "parseError"), the error has no line number. The fixed I applied temporarily to my jscs install was this, which a least prints the underlying reason for the parse error. I'm not sure if that's the best place for the fix or if it should be as soon as the parse error is detected. explainError: function(error, colorize) {
if (typeof error.line === 'undefined') {
//probably a parseError, so include the rule name
return formatErrorMessage(error.rule + ': ' + error.message, this.getFilename(), colorize);
}
//... the rest
} |
There is lot of different errors here and they about different things, like export function myFunction ({ foo = false, bar = null } = {}) {
console.log(foo, bar);
} Is cst/cst#118 static properties is about - cst/cst#112 And so on. After cst/cst#116 and with 729db94, errors will be outputted in a friendly manner |
pulling in the latest changes from master fixed this issue for me:
|
This is enough:
|
@zxqfox cool, thanks! |
For me problem still occurs. Even on the jscs-dev/node-jscs version. It's hard for me to paste example code because project is too large. |
Reporting in the same. Version 3.0.3. May move to ESLint as suggested though on the blog. For now I'm using the fix people have suggested. |
We gonna publish 3.0.4 in a few days with a fix (we hope). Can you please try master branch? |
I will try it on Monday (just finished work;)
|
Unfortunatly, I still get 'replace' of undefined error. :( On Fri, May 20, 2016 at 4:17 PM Sebastian mergol@gmail.com wrote:
|
Most basic example to get the error:
Results in:
|
After upgrading to 3.0.2, I can't seem to be able to get JSCS to work. Running the
jscs
CLI returns this error:My .jscsrc is:
The text was updated successfully, but these errors were encountered: