csstools / postcss-nesting

Nest style rules inside each other

Home Page:https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error using PostCSS 8

ehoogeveen-medweb opened this issue · comments

Processing my css files with the newly released PostCSS 8, I get the error below:

TypeError: string is not iterable
    at Object.split (<omitted>\node_modules\postcss\lib\list.js:13:24)
    at Object.comma (<omitted>\node_modules\postcss\lib\list.js:51:17)
    at Rule.get selectors [as selectors] (<omitted>\node_modules\postcss\lib\rule.js:14:17)
    at isRuleWithinRule (<omitted>\node_modules\postcss-nesting\index.cjs.js:51:102)
    at <omitted>\node_modules\postcss-nesting\index.cjs.js:114:11
    at Array.forEach (<anonymous>)
    at walk (<omitted>\node_modules\postcss-nesting\index.cjs.js:112:23)
    at <omitted>\node_modules\postcss-nesting\index.cjs.js:125:9
    at Array.forEach (<anonymous>)
    at walk (<omitted>\node_modules\postcss-nesting\index.cjs.js:112:23)
    at LazyResult.runOnRoot (<omitted>\node_modules\postcss\lib\lazy-result.js:287:16)
    at LazyResult.runAsync (<omitted>\node_modules\postcss\lib\lazy-result.js:339:26)
    at async Promise.all (index 21)

I don't know if the new version is triggering a bug in postcss-nesting or if it simply needs to be made compatible. Let me know if you need an actual testcase (I'm just filing this quickly to make you aware).

I don't have time atm to do this, but the migration guide is here for anyone else: https://evilmartians.com/chronicles/postcss-8-plugin-migration

I no longer see this issue with PostCSS 8.0.9, so it looks like this was a bug in PostCSS itself. Of course the desire for migration still applies, but I'll close this as the first comment would be misleading.