angular - Angular 8 TypeError: Cannot add property 2, object is not extensible
问题描述
I have an Angular 8 app using RxJS and angular-cesium that is in production for the past 6 months, and I had no issues.
In the past week the app works fine when I run ng serve
locally, but when I build it and deploy I am now getting this error when I make certain actions:
core.js.pre-build-optimizer.js:6014 ERROR TypeError: Cannot add property 2, object is not extensible
at Array.push (<anonymous>)
at l._subscribe (Subject.js.pre-build-optimizer.js:97)
at l._subscribe (BehaviorSubject.js.pre-build-optimizer.js:12)
at l._trySubscribe (Observable.js.pre-build-optimizer.js:42)
at l._trySubscribe (Subject.js.pre-build-optimizer.js:81)
at l.subscribe (Observable.js.pre-build-optimizer.js:28)
at je.call (app.component.ts:41)
at d.subscribe (Observable.js.pre-build-optimizer.js:23)
at IF.<anonymous> (lines-layer.component.ts:122)
at Generator.next (<anonymous>)
The start of the above stack trace (lines-layer.component.ts
) changes every time I build, but the last 6 lines (starting from Observable.js
) stay the same.
I also get the same error when I serve the dist
folder locally.
I've been debugging for a couple of days now and I've gotten nowhere... did anyone get this error too?
解决方案
我仍然不知道为什么会发生这种情况,但我(正确地)猜测它与我正在使用的某个库有关,所以我将它们全部更新到最新版本(包括 Angular 到版本 9)并且它成功了。
推荐阅读
- angular - ng2-nouislider 格式范围负载角 9
- machine-learning - 使用 doc2vec 查询文档相似度
- ios - 参数类型不符合预期的类型 MKAnnotation
- reactjs - 在 react 中从 formik 向 Firestore 提交数据
- javascript - 在 Javascript 中创建一个唯一的数组
- highcharts - Highcharts - 如果条形图上没有足够的空间,则更改文本颜色
- python - 如何根据访问频率将回访用户分类到不同的时间段
- docker - 通过 docker 镜像安装 jfrog 容器注册表的问题
- azure-active-directory - 通过订阅获取 Azure 应用程序
- r - 在 geom_point() 图上绘制 geom_arc()