Fix "TypeError: opts.node.rangeBy is not a function" with PostCSS 8.4.4
See original GitHub issueWhat steps are needed to reproduce the bug?
folder structure: package.json .stylelintrc.json styles.scss (empty file)
package.json:
{
"name": "untitled2",
"version": "0.0.0",
"private": true,
"scripts": {
"lint": "npx stylelint '**/*.scss'"
},
"devDependencies": {
"stylelint": "^14.1.0",
"stylelint-config-standard-scss": "^3.0.0"
}
}
npm i npm run lint
What Stylelint configuration is needed to reproduce the bug?
{
"extends": "stylelint-config-standard-scss"
}
How did you run Stylelint?
npx stylelint ‘**/*.scss’
Which version of Stylelint are you using?
^14.1.0
What did you expect to happen?
I expect stylelint to show list of errors.
What actually happened?
TypeError: opts.node.rangeBy is not a function
at new Warning (node_modules/postcss/lib/warning.js:9:29)
at Result.warn (node_modules/postcss/lib/result.js:26:19)
at report (node_modules/stylelint/lib/utils/report.js:103:9)
at node_modules/stylelint/lib/rules/no-empty-source/index.js:28:3
at node_modules/stylelint/lib/lintPostcssResult.js:112:8
at Array.map (<anonymous>)
at lintPostcssResult (node_modules/stylelint/lib/lintPostcssResult.js:103:18)
at lintSource (node_modules/stylelint/lib/lintSource.js:88:8)
at async node_modules/stylelint/lib/standalone.js:218:27
at async Promise.all (index 0)
Process finished with exit code 1
The problem is in this line
Does the bug relate to non-standard syntax?
No
Proposal to fix the bug
Works correctly with exactly 8.3.11 version of postcss.
I compared the code in warning.js
between these versions of postcss (8.3.11 and 8.4.4), they changed the method name. 😦
Proposal: change dependencies of stylelint to use exactly 8.3.11 version.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:25
- Comments:67 (36 by maintainers)
Top Results From Across the Web
opts.node.rangeBy is not a function" with PostCSS 8.4.4
Fix "TypeError: opts.node.rangeBy is not a function" with PostCSS 8.4.4.
Read more >PostCSS API
If you create a node manually (e.g., with postcss.decl() ), that node will not have a source property and will be absent from...
Read more >postcss/postcss - Gitter
A lot of TypeError: node.getIterator is not a function in tests after update postcss in css-loader, somebody say ... I am a bottom...
Read more >Error: PostCSS plugin tailwindcss requires PostCSS 8
I tried everything and was still having TypeError: getProcessedPlugins is not a function error. What fixed the issue ...
Read more >postcss@8.4.20 - jsDocs.io
If it's followed in the CSS by a {} block, this node will have a nodes property representing its children.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also started with a fresh install of
stylelint@14.1.0
andstylelint-config-standard-scss@3.0.0
. Ran into the same error described above. Installedpostcss@8.4.4
as @BroFox86 did, and the error is gone.Now let’s bump Stylelint with the latest PostCSS version and ask every user just to update
stylelint
in theirpackage.json
.Thanks to @JounQin and @snebjorn for solving this very complex bug.