postcss / autoprefixer

Parse CSS and add vendor prefixes to rules by Can I Use
https://twitter.com/autoprefixer
MIT License
21.58k stars 1.25k forks source link

Laravel mix error with grid-template-columns #1434

Closed maxxwv closed 2 years ago

maxxwv commented 2 years ago

I'm getting the following when using autoprefixer in Laravel mix 6.x with a browserslist including ie >= 9:

1 WARNING in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)

If I comment out the grid-template-columns line in my scss everything works without issue or warning. Any ideas?

My webpack.mix.js:

mix.setPublicPath(process.env.PUBLIC_PATH)
    .js('./js/app.js', `/js`)
  .sass('./scss/app.scss', `/css`)
    .options({
        processCssUrls: true,
        autoprefixer: {
            grid: true
        },
    })
;

package.json:

{
  "scripts": {
    "dev": "mix",
        "watch": "mix watch",
        "prod": "mix --production"
  },
  "devDependencies": {
    "laravel-mix": "^6",
    "resolve-url-loader": "^4.0.0",
    "sass": "^1.43.3",
    "sass-loader": "^12.2.0"
  },
    "browserslist": [
        "last 2 versions",
        "ie >= 10"
    ]
}

And finally, my scss:

.card-panel{
    max-width: calc(3 * 350px);
    display: grid;
    grid-template-columns: repeat(auto-fit, 300px);
    gap: 10px;
}

And output css:

.card-panel {
  max-width: 1050px;
  display: -ms-grid;
  display: grid;
  grid-template-columns: repeat(auto-fit, 300px);
  gap: 10px;
}
ai commented 2 years ago

Just use Laravel API to see the warning. It could be useful. Warning is not an error it warns you about the problem in input styles.

maxxwv commented 2 years ago

I'm not using Laravel, I'm using laravel-mix. And I realize a warning isn't an error, but it's reported as an error in the actual runtime notifications but then displays as a warning after the runtime in the terminal.

So are you saying the problem is with my SCSS? If so, where?

ai commented 2 years ago

So are you saying the problem is with my SCSS? If so, where?

Se the warning text. It will contain the source and the reason.