grunt-csso
grunt-csso copied to clipboard
Fatal error: Identifier is expected (958)
Package version: 2.2.0
Affected node versions: 8.1.4
My grunt-csso task fails with the error Fatal error: Identifier is expected (958).
grunt-csso and grunt-cli are installed locally.
I've taken these steps in my project.
rm -rf node_modules
npm i -D grunt-cli
npm i -D grunt-csso
npm i for the other packages
grunt
Running "csso:build" (csso) task
Fatal error: Identifier is expected (958)
Looks like a problem with either your css, or your gruntfile.
Can you run other tasks ?
Can you also run grunt --stack and give me the stack trace ?
Thanks!
Other tasks run successfully, and the error appears when the csso task starts. Excluding csso task results in all tasks completing successfully.
The --stack flag does not help in this instance as I get the same fatal error.
grunt --stack
Running "clean:build" (clean) task
>> 4 paths cleaned.
Running "copy:main" (copy) task
Copied 85 files
Running "sass:build" (sass) task
Running "postcss:dist" (postcss) task
>> 2 processed stylesheets created.
>> 2 sourcemaps created.
Running "concat:build" (concat) task
Running "imagemin:build" (imagemin) task
Minified 14 images (saved 4.83 kB)
Running "csso:build" (csso) task
Fatal error: Identifier is expected (965)
I simplified my CSSO grunt task as much as possible, but it continues to fail with the same fatal error
csso: {
build: {
files: {
'build/css/style.min.css': 'build/css/style.css'
}
}
}
Thanks for your help :)
I am sad to say this, but it looks like you css is invalid. https://github.com/csstree/csstree/blob/1a750f9f52a0397dc64fae07d7a358fad30d46be/lib/syntax/node/AttributeSelector.js#L37
That error message is at multiple places in the css parser https://github.com/csstree/csstree/search?p=1&q=%27Identifier+is+expected%27&type=&utf8=%E2%9C%93
I think we need to update the dependencies...
Thanks for the reply @nitriques . I'll try and locate CSS which is not being parsed.
No problem. I'll keep this issue open to remind me of updating the deps. Wanna share the 'build/css/style.min.css' file ?
@andrewfleming do you still have issues with this ?
Yes, I'm still seeing this issue.
A build/css/style.min.css file is not generated, so I'm not able to supply.
Can you share the source, i.e. build/css/style.css ?
Attached is the package.json, gemfile, gruntfile and sass files which should allow you to replicate the issue. csso-issue-31.zip
Can you just share the build/css/style.css file? I do not have ruby nor sass on my machine.
Here's a link to a gist with the CSS output https://gist.github.com/andrewfleming/e2fd3134c0d2cef3a9a765a7e34e4963
There are a couple of problems...
- https://gist.github.com/andrewfleming/e2fd3134c0d2cef3a9a765a7e34e4963#file-csso-debugging-L1079 (missing a 'd')
- https://gist.github.com/andrewfleming/e2fd3134c0d2cef3a9a765a7e34e4963#file-csso-debugging-L1188 keyframes animations can't be defined in a media query
- https://gist.github.com/andrewfleming/e2fd3134c0d2cef3a9a765a7e34e4963#file-csso-debugging-L1266 mixin call problems ?
I would suggest to make sure it's valid using https://jigsaw.w3.org/css-validator/validator
Here is where the error comes from : https://github.com/csstree/csstree/search?utf8=%E2%9C%93&q=RightParenthesis&type=