Parse PostCSS mixins error - a term expected

Hi!
have a WebStorm project with postCSS & plugins.
postCSS config:
```js
const path = require('path');

const env = process.env.NODE_ENV;
const plugins = [
    require('postcss-cssnext')({
        // browsers: ['Chrome >= 64', 'Firefox >= 58', 'Safari >= 11', 'iOS >= 10.13', 'Edge >= 41'],
        features: {
            autoprefixer: true,
        },
        cascade: false,
    }),
    require('postcss-utilities')({
        ie8: false,
        centerMethod: 'flexbox',
    }),
    require('postcss-mixins')({
        mixinsDir: path.resolve('./src/common/assets/css/mixins'),
    }),
];

if (env === 'production') {
    plugins.push(require('cssnano'));
}

module.exports = {
    plugins: plugins,
};
```

and have a mixin in size.pcss:
```css
@define-mixin size $size {
    width: $size;
    height: $size;
}
```
project compiles successfully but there is an error in code before symbol $ - Error: a term expected.

can you help me what the error is about, please!

0
4 comments

these errors indicate that this syntax can't be parsed. WebStorm provides no support for the syntax defined in https://github.com/postcss/postcss-mixins plugin

suppressing the error highlighting for your pcss file is the only way to get rid of the error. This can be done using Hector icon in the lower right corner: open your file in editor, click the Hector icon and then move the slider to change the Highlighting level to None. See https://www.jetbrains.com/help/webstorm/changing-highlighting-level-for-the-current-file.html. You will likely need to reopen the project to get the highlighting updated.

0

Thanks!

Solved with turning off IDE's support of postCSS

0

Preferences -> Languages & Frameworks -> Style Sheets -> Dialects, select POSTCSS. Profit!

0

Please sign in to leave a comment.