温馨提示:本文翻译自stackoverflow.com,查看原文请点击:deployment - How to identify the following problem given by Angular after production build?
angular build deployment production

deployment - 生产后如何识别Angular提出的以下问题?

发布于 2020-03-27 10:31:23

我在Angular中有一个大型项目,在生产构建(ng b --prod)和部署之后,它显示了一个白页和以下错误:

Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at i (main.5a0de34ba4bae8cec104.js:1)
    at main.5a0de34ba4bae8cec104.js:1
    at Module.zUnb (main.5a0de34ba4bae8cec104.js:1)
    at f (runtime.26209474bfa8dc87a77c.js:1)
    at Object.1 (main.5a0de34ba4bae8cec104.js:1)
    at f (runtime.26209474bfa8dc87a77c.js:1)
    at t (runtime.26209474bfa8dc87a77c.js:1)
    at Array.r [as push] (runtime.26209474bfa8dc87a77c.js:1)
    at main.5a0de34ba4bae8cec104.js:1

我已经发布了其他一些类似的项目,并且没有这种问题。

查看更多

查看更多

提问者
K. Anye
被浏览
191
K. Anye 2019-07-10 18:32

将项目从Angular 7.3。*更新到Angular 8后,运行以下构建命令

node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod 

我能够成功部署它。

注意:我还必须在angular.json中设置最大预算。