问题描述
我在使用 Bootstrap 文件 (Webpack Encore) 时遇到编译问题:
计算函数 percentage
时出错:参数必须是数字
/app/assets/less/variables.less 中的错误(第 302 行,第 26 列)
代码:@fluidGridColumnWidth: percentage(@gridColumnWidth/@gridRowWidth);
问题来自于用除法读取括号
如果:@fluidGridColumnWidth: percentage((@gridColumnWidth/@gridRowWidth));
-> 有效
我无法使用此解决方案,因为 Symfony 供应商的解决方案:
@import "../../vendor/twbs/bootstrap/less/bootstrap.less";
我尝试使用 StrictMath true 或 'division' -> 不起作用
.enableLessLoader((options) => { return {lessOptions: { strictMath: true}}; })
Nota Bene:我有另一个项目,我有相同的代码可以工作。所以我修复了与这个项目相同的版本,但它也不起作用。
感谢您的帮助
解决方法
替代:
删除 StrictMath -> 解决括号问题
在 background:url
计算中编译引导文件 4.3.1 的问题:
Cannot read property 'denominator' of undefined
我为这些行使用了 4.2.1 版的引导程序文件
DONE 编译成功