【问题标题】:Can't resolve 'font-path(%22bootstrap/glyphicons-halflings-regular.eot%22'无法解析 'font-path(%22bootstrap/glyphicons-halflings-regular.eot%22'
【发布时间】:2019-01-29 17:23:09
【问题描述】:

场景:

  • 从 Angular 2 迁移到 6 后出现错误。
  • 使用 angular-cli 创建一个新项目并将其源代码替换为 我的。
  • 在运行 ng serve 时,我收到以下详细信息:-

错误:
总共有6个错误。以下是 app.scss 文件:-

@import "~bootstrap-sass/assets/stylesheets/bootstrap-sprockets";
@import "~bootstrap-sass/assets/stylesheets/bootstrap";
@import "~font-awesome/scss/font-awesome.scss";
@import "bootstrap-checkbox.scss";
// @import "forms.scss";
// @import "main.scss";
@import "bootstrap-and-customizations.scss";
@import 'old.scss';
@import 'forms.scss';
@import "dashboard.scss";

【问题讨论】:

  • @if 在 scss 中,而不是通常的 if
  • 谢谢阿布舍克。你能详细点吗?此外,if(..) 位于第三方文件“~bootstrap-sass/assets/stylesheets/bootstrap”中。
  • 您的错误说 csssyntax 错误,所以我认为可能是它的 @if 错误,我没有查看详细信息,请检查您的语法或任何缺少的依赖项。对于 scss 语法参考:thesassway.com/intermediate/if-for-each-while
  • 是的,我已经更新了所有依赖项或至少我在 package.json 文件中可以理解的内容。我所编码的只是@import "~bootstrap-sass/assets/stylesheets/bootstrap";这给出了错误。
  • 我不知道,错误是它无法解析提供的字体路径,即src: url (path)。查看路径,查看指定路径上是否存在字体。

标签: css fonts sass bootstrap-4 angular6


【解决方案1】:

尝试像这样导入

@import "~bootstrap/scss/bootstrap.scss";

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-08
    • 2015-12-14
    • 2015-07-29
    • 2014-03-29
    • 2018-11-19
    • 2018-03-12
    • 1970-01-01
    相关资源
    最近更新 更多