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

Get "Cannot read property 'first' of null" error with :root selector #647

Open
maliyshock opened this issue Sep 14, 2021 · 0 comments
Open

Comments

@maliyshock
Copy link

maliyshock commented Sep 14, 2021

I tried to use 4.2.0 version of CSS comb, and I got this error

"comb": "node node_modules/csscomb/src/cli.js -c .csscomb.json src/scss",

csscomb/lib/options/sort-order.js:163
let property = node.first('property').first();
                                    ^
TypeError: Cannot read property 'first' of null

I believe the problem occurs when you are trying to use :root selector.

The same thing happens here https://gitmemory.com/issue/csscomb/csscomb.js/625/820750672
The workaround is to use

"devDependencies": {
    "csscomb": "csscomb/csscomb.js#1f27f9e4e0f6a9f0849b6fc6e8325baf9371aeaf"
}

and

"scripts": {
    "comb": "node node_modules/csscomb/src/cli.js -c .csscomb.json src/scss",
}

I would be happy to use CSS comb without that kind of patches. Thanks!

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

1 participant