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

TypeError: rangeData.all is not iterable needlessDisables.js:61:33 #5092

Open
olderor opened this issue Dec 26, 2020 · 11 comments
Open

TypeError: rangeData.all is not iterable needlessDisables.js:61:33 #5092

olderor opened this issue Dec 26, 2020 · 11 comments
Labels
status: needs clarification triage needs clarification from author

Comments

@olderor
Copy link

olderor commented Dec 26, 2020

Clearly describe the bug

The issue in version 13.8.0 (13.7.2 was working correctly).

The error:

TypeError: rangeData.all is not iterable
    at node_modules\stylelint\lib\needlessDisables.js:61:33
    at Array.forEach (<anonymous>)
    at module.exports (node_modules\stylelint\lib\needlessDisables.js:15:10)
    at prepareReturnValue (node_modules\stylelint\lib\prepareReturnValue.js:30:30)
    at node_modules\stylelint\lib\standalone.js:289:16
error Command failed with exit code 1.

Probably some regression introduced in this PR #4973

The version of node I use: 12.18.1

Which rule, if any, is the bug related to?

No specific rules, the issue seems to be in the core.

What code is needed to reproduce the bug?

No code is needed, just run stylelint. npx stylelint \"**/*.scss\" --max-warnings 0 --risd --rdd --rd

@hudochenkov
Copy link
Member

Please use issue template. We can't help with these details.

@olderor
Copy link
Author

olderor commented Dec 26, 2020

Hi @nex3 , can you please take a look at the issue as you were the author of the PR? Thanks.

@nex3
Copy link
Contributor

nex3 commented Dec 28, 2020

This isn't enough info for me to reproduce. From a visual inspection of the code, it looks like disabledRanges.all is always set to an array, so it's unclear a priori why this would fail:

/**
* Most of the functions below work via side effects mutating this object
* @type {DisabledRangeObject}
*/
const disabledRanges = {
all: [],
};
result.stylelint.disabledRanges = disabledRanges;

If you can provide me with a stylelint config and CSS file that consistently reproduces this, I can dive in further.

@hudochenkov hudochenkov added the status: needs clarification triage needs clarification from author label Jan 1, 2021
@olderor
Copy link
Author

olderor commented Jan 13, 2021

Closing the issue as I cannot repro it now.

@olderor olderor closed this as completed Jan 13, 2021
@olderor
Copy link
Author

olderor commented Jan 13, 2021

FYI: After my investigation, I figured out that the issue was causing 'ignoreFiles' in the configuration. For some reason, the new version of stylelint was producing this error, when the old version was working normally. Once I removed ignoreFiles, and moved the patterns to .stylelintignore instead, the issue was gone. Not sure why ignoreFiles is causing this behavior.

@starikcetin
Copy link

This problem still exists. As soon as I added ignoreFiles, I started getting this error. The problem is the VSCode extension stylelint.vscode-stylelint does not respect my .stylelintignore file, so I am kind of stuck here.

@fiso
Copy link

fiso commented Apr 1, 2021

I still have this problem. Here is my config out of a screenshot.
image

@nex3
Copy link
Contributor

nex3 commented Apr 6, 2021

Again, if you can provide me a minimal reproduction of this issue, I can investigate further.

@olderor
Copy link
Author

olderor commented Apr 8, 2021

From a visual inspection of the code, I've found at least 3 places where disabledRanges is not initialized as you expect:

result.stylelint = result.stylelint || {
ruleSeverities: {},
customMessages: {},
};

const stylelintResult = {
ruleSeverities: {},
customMessages: {},
disabledRanges: {},
};

stylelint/lib/lintSource.js

Lines 108 to 114 in 0a2e727

return {
ruleSeverities: {},
customMessages: {},
disabledRanges: {},
ignored: true,
stylelintError: false,
};

@olderor olderor reopened this Apr 8, 2021
@olderor
Copy link
Author

olderor commented Apr 8, 2021

Reopening as the issue is reported by multiple people, but for me the workaround was to move the patterns to .stylelintignore

@Mouvedia
Copy link
Contributor

Mouvedia commented Jun 11, 2023

@olderor would adding

"disabledRanges": { 
  "all": [], 
}

to lintSource.js and report.js fix the problem?

If not, would adding this piece of information to the documentation fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs clarification triage needs clarification from author
Development

No branches or pull requests

6 participants