Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Version 5.0.0] Error: true is not a PostCSS plugin #73

Closed
wang1212 opened this issue Nov 4, 2020 · 2 comments
Closed

[Version 5.0.0] Error: true is not a PostCSS plugin #73

wang1212 opened this issue Nov 4, 2020 · 2 comments

Comments

@wang1212
Copy link

wang1212 commented Nov 4, 2020

When I upgraded from v4.2.1 to v5.0.0, the following error occurred:

Error: true is not a PostCSS plugin

When I rolled back to v4.2.1, the error disappeared.


I use webpack and use postcss-loader to load the plugin:

  • webpack ^4.44.2
  • postcss-loader ^4.0.4
  • postcss-flexbugs-fixes ^5.0.0
{
	loader: 'postcss-loader',
	options: {
		sourceMap: isEnvDevelopment,
		postcssOptions: {
			// Necessary for external CSS imports to work
			// https://github.com/facebook/create-react-app/issues/2677
			ident: 'postcss',
			plugins: [
				require('cssnano')({
					preset: 'default',
				}),
				require('postcss-flexbugs-fixes'),
				require('postcss-preset-env')({
					autoprefixer: {
						flexbox: 'no-2009',
					},
					stage: 3,
				}),
				// Adds PostCSS Normalize as the reset css with default options,
				// so that it honors browserslist config in package.json
				// which in turn let's users customize the target behavior as per their needs.
				postcssNormalize(),
			],
		},
	},
},

I checked the postcss-loader version changlelog, v4.0.4 supports loading postcss V8 api plugins, but I currently don’t understand why the above-mentioned error occurs?


I guess it may be related to the webpack version, I use webpack V5.4.0 and everything is normal.

@s100
Copy link
Contributor

s100 commented Nov 6, 2020

It may or may not be relevant that although postcss-flexbugs-fixes@5.0.0 uses postcss at run time, it does not specify a production dependency on any particular version of postcss. It does specify a development dependency on postcss@8, but a consumer running npm install postcss-flexbugs-fixes@5 will not see any particular version of postcss installed - and if there is a version of postcss already installed, postcss@7, say, it will stay where it is, and postcss-flexbugs-fixes@5 will try to use it, possibly leading to strange errors.

@luisrudge
Copy link
Owner

fixed in #74 - version 5.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants