Angular: TypeError: Cannot read property 'firstCreatePass' of null

Angular: TypeError: Cannot read property 'firstCreatePass' of null

将 angular 更新到版本 10 后,我看到了这个控制台错误。

ERROR TypeError: Cannot read property 'firstCreatePass' of null

更新前没有。 它在加载带有自定义组件的视图时显示。

可能缺少什么?

原来是因为我也更新了ngx-custom-validators包。

但是想要的 ngx-custom-validators 版本是 8.0.0。 更改版本后它起作用了。

https://github.com/rsaenen/ngx-custom-validators/issues/39#issuecomment-654024141

我在升级到 angular11 时遇到了同样的错误。我们正在动态加载模块并使用自定义元素(更多细节在这里:https://angular.io/guide/elements)。

在我的例子中,我没有覆盖服务器上的文件,而是先删除所有旧文件,然后上传更新的文件,这解决了我的问题。