Autoprefixer: Cannot use class `.selectors` when using with postcss-modules

Created on 29 Nov 2019  路  3Comments  路  Source: postcss/autoprefixer

Using a class name of .selectors when running with postcss-modules then autoprefixer causes the following error:

UnhandledPromiseRejectionWarning: TypeError: checker.check is not a function

This happens at this line.

Minimal reproduction:

const autoprefixer = require("autoprefixer");
const cssModules = require("postcss-modules");
const postcss = require("postcss");

const css = `
.selectors {
  color: red;
}
`;

postcss([
  cssModules,
  autoprefixer
])
  .process(css)
  .then(result => console.log(result.css));

Sticking a log above the erroring line to show checker yields the following:

OldValue {
  unprefixed: 'calc',
  prefixed: '-webkit-calc',
  string: '-webkit-calc',
  regexp: /(^|[\s,(])(\-webkit\-calc($|[\s(,]))/gi }
OldValue {
  unprefixed: 'calc',
  prefixed: '-moz-calc',
  string: '-moz-calc',
  regexp: /(^|[\s,(])(\-moz\-calc($|[\s(,]))/gi }
OldValue {
  unprefixed: 'calc',
  prefixed: '-webkit-calc',
  string: '-webkit-calc',
  regexp: /(^|[\s,(])(\-webkit\-calc($|[\s(,]))/gi }
OldValue {
  unprefixed: 'calc',
  prefixed: '-moz-calc',
  string: '-moz-calc',
  regexp: /(^|[\s,(])(\-moz\-calc($|[\s(,]))/gi }
[Function: values] // Looks like the checker is being overriden by a function

Most helpful comment

Fixed 33ee989

All 3 comments

Fixed 33ee989

Released in 9.7.3

Awesome thanks for getting this fixed so fast

Was this page helpful?
0 / 5 - 0 ratings