【发布时间】:2019-02-14 16:59:45
【问题描述】:
在上次 npm 更新之前一切正常
看http://projects.mcrit.com/dist/
我正在使用:
Angular CLI: 1.6.56
Node: 8.9.4
OS: linux x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router
@angular/cdk: 5.1.0
@angular/cli: 1.6.5
@angular/material: 5.1.0
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.16
typescript: 2.6.2
webpack: 3.10.0
我可以使用 ng build -prod 编译应用程序,但在 apache 服务器上部署的应用程序失败。
Chrome 消息是:Uncaught SyntaxError: Unexpected token , Firefox 消息是:SyntaxError: missing ) after for-loop control
没有 -prod 构建在服务器上工作正常
有人可以帮帮我吗?
【问题讨论】:
-
请提供出现错误的组件代码示例
-
我不确定你的意思。错误在 main.xxxxxxxxxxxx.js 文件中
-
检查 ng serve --prod --source-map
-
编译成功。但是 localhost:4200 作为编译和部署的版本失败。