gpt4 book ai didi

css - webpack encore构建报错: Module build failed: Unclosed block

转载 作者:行者123 更新时间:2023-11-27 23:12:09 25 4
gpt4 key购买 nike

symfony 中使用 encore 构建我的 webpack 时出现错误。

我试过多次删除 node_modules。并使用 yarn install 重新安装。但是找不到解决方案。它以前一直在工作,但我认为更新后它坏了。当我取消注释引导行时,一切都会构建。

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.

我已经尝试过独立构建 Bootstrap scss,而且效果很好。这就是为什么我认为 node_modules 有问题。

最佳答案

通过将 @symfony/webpack-encore 更新到 package.json 文件中的最新版本来修复问题。运行“yarn upgrade”后它起作用了。

关于css - webpack encore构建报错: Module build failed: Unclosed block,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58468126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com