I get an error when building my webpack
using encore in symfony
.
I've tried various time removing node_modules. and reinstall with yarn install. But can't find the solution. It has been working before, but I think after update, it broke. When I uncomment the bootstrap line everything builds.
global.scss
// customize some Bootstrap variables
$primary: darken(#49a94a, 10%);
// the ~ allows you to reference things in node_modules
@import "~bootstrap/scss/bootstrap";
@import '~@fortawesome/fontawesome-free/css/all.css';
yarn encore dev
Running webpack ...
ERROR Failed to compile with 2 errors 23:05:40
error in ./assets/css/global.scss
Module build failed: ModuleBuildError: Module build failed: Unclosed block (229:4)
227 |
228 | svg {
> 229 | overflow: hidden;
| ^
230 | vertical-align: middle;
231 | }
232 |
at /home/user/Web/kcl_symfony4/node_modules/webpack/lib/NormalModule.js:195:19
at /home/user/Web/kcl_symfony4/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /home/user/Web/kcl_symfony4/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/home/user/Web/kcl_symfony4/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.<anonymous> (/home/user/Web/kcl_symfony4/node_modules/css-loader/lib/loader.js:31:18)
at /home/user/Web/kcl_symfony4/node_modules/css-loader/lib/processCss.js:222:4
error in ./assets/css/global.scss
Module build failed: Unclosed block (229:4)
227 |
228 | svg {
> 229 | overflow: hidden;
| ^
230 | vertical-align: middle;
231 | }
232 |
@ ./assets/css/global.scss 4:14-199
@ ./assets/js/app.js
error Command failed with exit code 2.
I've tried with building Bootstrap scss standalone and that works. That why I think something is wrong with node_modules.
Problem fixed by updating @symfony/webpack-encore. Found solution here: https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/issues/287
Problem fixed by updating @symfony/webpack-encore to most current version in the package.json file. After running "yarn upgrade" it worked.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.