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 'errored' of undefined #18

Closed
amk221 opened this issue Oct 10, 2016 · 14 comments
Closed

Cannot read property 'errored' of undefined #18

amk221 opened this issue Oct 10, 2016 · 14 comments

Comments

@amk221
Copy link

amk221 commented Oct 10, 2016

This morning our builds started failing, with this error:

The Broccoli Plugin: [StyleLinter] failed with:
TypeError: Cannot read property 'errored' of undefined
    at StyleLinter.postProcess (/Users/andrew/src/foo/ember/node_modules/broccoli-stylelint/index.js:137:12)
    at /Users/andrew/src/foo/ember/node_modules/broccoli-persistent-filter/lib/strategies/default.js:21:21
    at initializePromise (/Users/andrew/src/foo/ember/node_modules/rsvp/dist/rsvp.js:588:5)
    at new Promise (/Users/andrew/src/foo/ember/node_modules/rsvp/dist/rsvp.js:1076:31)
    at /Users/andrew/src/foo/ember/node_modules/broccoli-persistent-filter/lib/strategies/default.js:20:14
    at tryCatch (/Users/andrew/src/foo/ember/node_modules/rsvp/dist/rsvp.js:538:12)
    at invokeCallback (/Users/andrew/src/foo/ember/node_modules/rsvp/dist/rsvp.js:553:13)
    at publish (/Users/andrew/src/foo/ember/node_modules/rsvp/dist/rsvp.js:521:7)
    at flush (/Users/andrew/src/foo/ember/node_modules/rsvp/dist/rsvp.js:2373:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
@pfmmfp
Copy link
Contributor

pfmmfp commented Oct 24, 2016

So I've found that the error started to show up with stylelint 7.4.0. It can be reproduced by cloning latest master and running tests with npm test.

It seems that starting from that version, stylelint requires that the codeFilename parameter can actually be resolved in the filesystem. Not completely sure, but this one might have caused it.

The PR I've just sent has the intention of fixing this problem by prepending the inputNodes directory in the relativePath that corresponds to each of the files being linted -- ref this line

Not sure if this is the best approach in regards to broccoli best practices, but got some inspiration based on the eslint plugin, although improved it to use the broccoli-node-info wrapper.

@billybonks what do you think?

@billybonks
Copy link
Owner

Hey guys, i really need to setup a watcher for issues created on the repo 👍 just wanted to let you know that i am going to look through all of this and get back to you very soon @pfmmfp thanks for the prerequisite research

@williamweckl
Copy link

HI guys, any news on this one? Is there a way to do a temporary fix?

@billybonks
Copy link
Owner

so i have released ember-cli-stylelint v0.6.3 it has locked the versions of every dependency so that this doesn't happen again.

for now we will be on stylelint version 7.3 i will work with @pfmmfp to solve this asap so we can get new versions :)

@billybonks
Copy link
Owner

billybonks commented Nov 9, 2016

@amk221 so i merged @pfmmfp's pull request but would like to make sure it works with your setup. since it is the most interesting one billybonks/ember-cli-stylelint#3. can you test this for us

change the dependency in ember ember-cli-stylelint of broccoli-stylelint to

"broccoli-stylelint": "billybonks/broccoli-stylelint#master"

@amk221
Copy link
Author

amk221 commented Nov 10, 2016

@billybonks Thanks, I tried that and it worked.

@williamweckl
Copy link

Worked for me too. Thanks!

@RobbieTheWagner
Copy link
Contributor

I'm seeing this again now, on latest ember-cli-stylelint. Does anyone know of a fix?

@amk221
Copy link
Author

amk221 commented Jun 18, 2019

I moved away from ember-cli-stylelint and therefore also broccoli-stylint, in favour of adding this to package.json in our app

“scripts”: {
  "lint:css": "stylelint '**/*.{css,scss}'”
}

@RobbieTheWagner
Copy link
Contributor

@amk221 that removes the unit tests for failing stylelint though, which I think is nice to have.

@amk221
Copy link
Author

amk221 commented Jun 19, 2019

@rwwagner90 Sorry I should have clarified

"test": "yarn exam && yarn lint",
"lint": "yarn lint:js & yarn lint:hbs & yarn lint:css",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"lint:css": "stylelint '**/*.{css,scss}'"

..mind you I suppose you will miss them in the browser. My bad.

@RobbieTheWagner
Copy link
Contributor

@amk221 you still lose the ability to generate unit tests for failing stylelint is what I mean. I like how ember-cli-stylelint and ember-cli-eslint generate unit tests for you.

@billybonks
Copy link
Owner

will aim to have this resolved by this time tomorrow, still working on my end :/

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

No branches or pull requests

5 participants