Roots Discourse

Sage 9 postCSS issue

Hi there,

Just after installing of sage started theme using Tailwind as an option I’m getting the following issue.

Module build failed: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.

  • options has an unknown property ‘plugins’. These properties are valid:
    object { postcssOptions?, execute?, sourceMap? }

Tried to downgrade postcss-loader but doesn’t work.

Can you please advise?

The most recent sage version 9.0.10 has had issues with dependences. Not sure if what you’ve experienced falls into the same bucket, but you might want to try with a clean 9.0.9.

What version are you using for the following:

  • Sage
  • Node

Thank you! I’ll try.

I’m use

Sage 9.0.10
Node 10.17.0

I would try w/ the current LTS release of node, which is 14.x. I recommend using nvm or volta to manage multiple Node versions, if you aren’t already.

Thank you! I’ve tried node 14.15.0, and still the same

Ensure that in your webpack.config.preset.js postcss loader object looks like this:

          loader: 'postcss',
          options: {
            postcssOptions: {
              parser: config.enabled.optimize
                ? 'postcss-safe-parser'
                : undefined,
              plugins: postcssPlugins,
              sourceMap: false,

Notice postcssOptions