Laravel-mix: Postcss error in production

Created on 10 Mar 2020  路  2Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 5.0.1 (npm list --depth=0)
  • Node Version (node -v): 10.16.1
  • Yarn Version (npm -v): 1.21.1
  • OS: Ubuntu Linux

Description:

Same as issue #2329

Steps To Reproduce:

Try to run laravel-mix in production and compile bootstrap sass files.

yarn run v1.21.1
$ yarn run production
$ cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js


 ERROR  Failed to compile with 2 errors                                                                                                     2:47:53 PM

 error  in ./resources/sass/app.scss

Syntax Error: ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
SyntaxError

(259:4) Unclosed block

  257 | 
  258 |   .navbar-toggler-icon {
> 259 |     background-image: escape-svg($navbar-light-toggler-icon-bg);
      |    ^
  260 |   }
  261 | 


 error  in ./resources/sass/app.scss

Syntax Error: SyntaxError

(259:4) Unclosed block

  257 | 
  258 |   .navbar-toggler-icon {
> 259 |     background-image: escape-svg($navbar-light-toggler-icon-bg);
      |    ^
  260 |   }
  261 | 



 @ ./resources/sass/app.scss 2:14-253

Webpack Bundle Analyzer is started at http://127.0.0.1:8888
Use Ctrl+C to close it
 4 assets

ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
SyntaxError

(259:4) Unclosed block

  257 | 
  258 |   .navbar-toggler-icon {
> 259 |     background-image: escape-svg($navbar-light-toggler-icon-bg);
      |    ^
  260 |   }
  261 | 

    at runLoaders (/home/sina/projects/bitlancer/node_modules/webpack/lib/NormalModule.js:316:20)
    at /home/sina/projects/bitlancer/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/sina/projects/bitlancer/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/sina/projects/bitlancer/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Promise.resolve.then.then.catch (/home/sina/projects/bitlancer/node_modules/postcss-loader/src/index.js:207:9)
 @ ./resources/sass/app.scss

ERROR in ./resources/sass/app.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!./node_modules/resolve-url-loader??ref--5-4!./node_modules/sass-loader/dist/cjs.js??ref--5-5!./resources/sass/app.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
SyntaxError

(259:4) Unclosed block

  257 | 
  258 |   .navbar-toggler-icon {
> 259 |     background-image: escape-svg($navbar-light-toggler-icon-bg);
      |    ^
  260 |   }
  261 | 

 @ ./resources/sass/app.scss 2:14-253

Most helpful comment

Just an updating of sass-loader and it's ok.
npm install -D sass-loader@^8.0.0

All 2 comments

I fixed this by updating all dependencies to the latest version.

Just an updating of sass-loader and it's ok.
npm install -D sass-loader@^8.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Micaso picture Micaso  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

RomainGoncalves picture RomainGoncalves  路  3Comments

nezaboravi picture nezaboravi  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments