gatsby-plugin-sass error with postCssAssets
See original GitHub issueDescription
Upgraded from gatsby-plugin-sass ^2.3.22 to ^2.4.1 No indication from the documentation of any breaking change that I can see, but now when I try and run gatsby develop I get the following error message:
error Invalid plugin options for "gatsby-plugin-sass":
- "postCssPlugins[1]" must be of type object
- "postCssPlugins[2]" must be of type object
My config hasn’t changed.
const postcssAssets = require('postcss-assets');
const postcssNormalize = require('postcss-normalize');
const postcssPresetEnv = require('postcss-preset-env');
const sass = require('sass');
...
{
resolve: 'gatsby-plugin-sass',
options: {
implementation: sass,
postCssPlugins: [
postcssAssets({
loadPaths: ['/src/assets/images'],
relative: true
}),
postcssNormalize,
postcssPresetEnv
]
}
}
I tried changing both postcssNormalize
and postcssPresetEnv
to postcssNormalize()
and postcssPresetEnv()
but it didn’t change anything (and I don’t think I should need to do this anyway?)
Steps to reproduce
Clear steps describing how to reproduce the issue. Please please please link to a demo project if possible, this makes your issue much easier to diagnose (seriously).
How to Make a Minimal Reproduction: https://www.gatsbyjs.org/contributing/how-to-make-a-reproducible-test-case/
Expected result
Project runs
Actual result
success open and validate gatsby-configs - 0.514s
error Invalid plugin options for "gatsby-plugin-sass":
- "postCssPlugins[1]" must be of type object
- "postCssPlugins[2]" must be of type object
not finished load plugins - 0.147s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! menu-web-beta@0.2.0 develop: `gatsby develop -H 0.0.0.0`
npm ERR! Exit status 1
Environment
gatsby info --clipboard
System: OS: macOS 10.15.7 CPU: (16) x64 Intel® Xeon® CPU E5-1680 v2 @ 3.00GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 15.0.1 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.8 - /usr/local/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 86.0.4240.111 Edge: 86.0.622.61 Firefox: 82.0.2 Safari: 14.0 npmPackages: gatsby: ^2.25.1 => 2.25.1 gatsby-cli: ^2.12.115 => 2.12.115 gatsby-plugin-manifest: ^2.5.1 => 2.5.1 gatsby-plugin-offline: ^3.3.1 => 3.3.1 gatsby-plugin-preload-fonts: ^1.2.29 => 1.2.29 gatsby-plugin-react-helmet: ^3.3.14 => 3.3.14 gatsby-plugin-robots-txt: ^1.5.3 => 1.5.3 gatsby-plugin-sass: ^2.4.1 => 2.4.1 gatsby-plugin-sharp: ^2.7.0 => 2.7.0 gatsby-plugin-sitemap: ^2.5.0 => 2.5.0 gatsby-source-filesystem: ^2.4.0 => 2.4.0 gatsby-source-graphql: ^2.7.6 => 2.7.6 gatsby-transformer-sharp: ^2.5.21 => 2.5.21
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (2 by maintainers)
Top GitHub Comments
Fix incoming! Thanks for the detailed report folks, sorry about the troubles 👍
this is still an issue 😭