【问题标题】:Angular 14 Error: Transform failed with 1 error: ERROR: Unterminated string tokenAngular 14 错误:转换失败,出现 1 个错误:错误:未终止的字符串标记
【发布时间】:2022-08-03 03:47:52
【问题描述】:

当运行 ng serve 我有这个结果:

*./src/main.ts - 错误:模块构建失败 (来自./node_modules/@ngtools/webpack/src/ivy/index.js) ../.component.scss:17:100:错误:未终止的字符串标记

*./src/polyfills.ts` - 错误:模块构建失败 (来自./node_modules/@ngtools/webpack/src/ivy/index.js) ../.component.scss:17:100:错误:未终止的字符串标记

这个角度版本

角 CLI:14.0.6
    节点:16.16.0
    包管理器:NPM 8.14.0
    操作系统:win32 x64
    
    角度:14.0.6
    
    包版本
    -------------------------------------------------- --------
    @angular-devkit/架构师 0.1400.6
    @angular-devkit/build-angular 14.0.6
    @angular-devkit/核心 14.0.6
    @angular-devkit/原理图 14.0.6
    `@angular/cdk 14.0.5`
    @角/材料14.0.5
    @nguniversal/express-engine 7.1.1
    @原理图/角度 14.0.6
    `rxjs 6.6.7`
    打字稿4.6.4

/.component.scss

input[type=text]:disabled {
  color: black;
}

.search-row {
  .form-group > label {
    font-size: 1.1em !important;
      color: black;
  }
}

.mat-table {
  th.mat-header-cell {
    font-size: 1.1em !important;
      color: black;
  }
}//<< here line 17.


#block {
  margin: 0% 10%;
}
...

谢谢您的帮助

  • ../.component.scss 中的第 17 行是什么样的? (您发布的信息中有一些奇怪的字符串标记让我感到不舒服,但可能是无关的。例如*./src/polyfills.ts[string token] Error: Module build failed
  • 我解决了,我认为这与我的angular.json 文件有关。
  • 您介意分享您在angular.json 文件中所做的更改吗?

标签: css angular sass node-sass


【解决方案1】:

运行以下命令

npx browserslist --update-db

【讨论】:

    猜你喜欢
    • 2022-06-18
    • 2012-12-07
    • 2022-10-05
    • 1970-01-01
    • 2014-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多