You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular 12执行ng build生产构建时偶现Unexpected token ')'语法错误

Angular 12生产构建偶现语法错误问题

使用Angular 12开发的项目,执行ng build --configuration=production命令构建生产版本时,部分系统会偶发Uncaught SyntaxError: Unexpected token ')'错误。清除浏览器缓存后错误可能暂时消失,但后续仍会再次出现。

错误截图如下:
错误截图1
错误截图2

项目的index.html代码如下:

<html lang="fa" class="h-100">

<head>
  <meta charset="utf-8">
  <title>Project</title>
  <base href="/">
  <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Expires" content="0" />
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

<body class="h-100 fixed-menu">
  <app-root></app-root>
</body>

</html>

内容的提问来源于stack exchange,提问作者ali m

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 08:40:41