Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Strange LESS file message #181

Closed
smlombardi opened this issue Apr 27, 2016 · 12 comments
Closed

Strange LESS file message #181

smlombardi opened this issue Apr 27, 2016 · 12 comments

Comments

@smlombardi
Copy link

I was editing my theme and got this:

screen shot 2016-04-27 at 8 08 09 am

@Arcanemagus
Copy link
Member

Can you upload the raw file? Does stylelint itself show that error if you run from the CLI?

@smlombardi
Copy link
Author

i can't get it to happen again. I will keep an eye out.

@Arcanemagus
Copy link
Member

Okay, marking as Unable to reproduce and closing for now.

@gregorywyz
Copy link

gregorywyz commented Jan 3, 2017

This happens when I create a new less file and attempt to create a new classname. The error is triggered just before typing the opening bracket. This also, does not show up when running stylelint through command line

@Arcanemagus
Copy link
Member

Arcanemagus commented Feb 15, 2017

Managed to reproduce this intermittently from your steps @gregorywyz. Got the following stack trace which tells us that this is a bug in postcss-less:

TypeError: Cannot read property '2' of undefined
    at LessParser.rule (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss-less\dist\less-parser.js:64:38)
    at LessParser.createRule (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss-less\dist\less-parser.js:110:18)
    at LessParser.ruleWithoutBody (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss-less\dist\less-parser.js:141:18)
    at LessParser.processEndOfRule (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss-less\dist\less-parser.js:173:22)
    at LessParser.word (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss-less\dist\less-parser.js:272:44)
    at LessParser.loop (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss-less\dist\less-parser.js:300:30)
    at lessParse (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss-less\dist\less-parse.js:23:12)
    at new LazyResult (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss\lib\lazy-result.js:70:24)
    at Processor.process (C:\Users\Landon Abney\.atom\packages\linter-stylelint\node_modules\postcss\lib\processor.js:117:12)
    at file:///C:/Users/Landon Abney/Documents/GitHub-release/linter-stylelint/node_modules/stylelint/lib/getPostcssResult.js:81:29

Unfortunately postcss-less is currently unmaintained, so the hopes of this getting fixed are low.

@Arcanemagus
Copy link
Member

Filed an issue there, hopefully it can be taken care of when somebody takes on that project again.

@shellscape
Copy link

@Arcanemagus @gregorywyz I've been given ownership of postcss-less and will be actively maintaining it for the foreseeable future. If you all can get me a file or line that produces an error consistently using the parsing methods shown here, I can probably debug it. Unfortunately I don't have a whole bunch of interest in debugging it through Atom, through the plugin system, and through the plugin itself 😄

@Arcanemagus
Copy link
Member

@shellscape I'll see what I can do, it's an intermittent issue though so reproducing it out of that environment will likely be difficult.

@Arcanemagus
Copy link
Member

Also, I would much rather keep discussion over in shellscape/postcss-less#64 as the bug has nothing to do with this package's code.

@abea
Copy link

abea commented Jun 30, 2017

I see in shellscape/postcss-less#64 that this should be resolved on that end as well as in this linter. My linter-stylelint package is up to date but I'm still getting this error when writing a new selector. Is there something I'm missing or that isn't yet updated?

@shellscape
Copy link

@abea stylelint may not have updated to the version which has that fix, or the linter plugin may not be following the pattern of trapping that error as a user types. @Arcanemagus that's probably something this plugin will have to do, rather than the stylelint package - you may wish to reopen this one.

@Arcanemagus
Copy link
Member

Looks like stylelint only updated postcss-less in stylelint/stylelint#2702, which will be included in stylelint@8.

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

5 participants