Gatsby: composes from another file not working in my gatsby project

Created on 25 Sep 2018  路  2Comments  路  Source: gatsbyjs/gatsby

Trying to use composes from another file in Gatsby but keep getting this error.
I'm using css modules as scss modules.
I tried the following.

.myclass {
  composes: tempClass from "styles/common.scss"
}
.myclass {
  composes: tempClass from "styles/common.module.scss"
}

Your current PostCSS version is 5.2.18, but postcss-nesting uses 6.0.23. Perhaps this is the source of the error below.

gatsby -v
1.1.58

How can I update PostCSS version in gatsby ?

Setup:

    resolve: `gatsby-plugin-postcss-sass`,
      options: {
        postCssPlugins: [
          require('postcss-cssnext')(),
          require('rucksack-css')(),
          require('css-mqpacker')(),
        ],
      },
question or discussion

Most helpful comment

Thanks kakadiadarpan not right now but good to know its fixed on V2.

All 2 comments

@eric-personal would it be possible for you to upgrade to Gatsby v2? That would be the easiest way to resolve this. If you cannot then you'll need to fork gatsby-plugin-postcss-sass and upgrade the dependencies there.

We recommend upgrading to v2 as we have made a lot of internal changes.

Thanks kakadiadarpan not right now but good to know its fixed on V2.

Was this page helpful?
0 / 5 - 0 ratings