使用 Angular CDN 的多个未捕获类型错误

Multiple Uncaught TypeErrors using Angular CDN

应用程序在本地服务时工作正常...

我正在尝试将其合并到 Web 内容管理系统中,这需要一些编译和准备工作才能将文件导入其中。我用gulp将TS转成JS,SCSS转成CSS并缩小等。然后这些文件分别导入到WCMS的特定区域。我还必须将 CDN 用于 Angular 框架等,例如

https://unpkg.com/@angular/core@11.0.9/bundles/core.umd.min.js

https://unpkg.com/@angular/common@11.0.9/bundles/common.umd.min.js

https://unpkg.com/@angular/platform-browser@11.0.9/bundles/platform-browser.umd.min.js

https://unpkg.com/rxjs@7.0.0/dist/bundles/rxjs.umd.min.js

我在控制台中收到多个错误...

Uncaught TypeError: Cannot read property 'operators' of undefined at core.umd.min.js:6

当我在源代码中查看文件时,它突出显示了这一点:rxjs.operators)}(this,(function(t,e,n,r,o){"use strict";

Uncaught TypeError: t.InjectionToken is not a constructor at common.umd.min.js:35

当我在源代码中查看文件时,它突出显示以以下内容开头的行:var c,l=new t.InjectionToken("DocumentToken");function

Uncaught TypeError: Cannot read property 'operators' of undefined at common-http.umd.min.js:6

当我在源代码中查看文件时,它突出显示了这一点:rxjs.operators,e.ng.common)}(this,(function(e,t,r,n,o){"use strict";

Uncaught TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf () at n (platform-browser.umd.min.js:20)

当我在源代码中查看文件时,它突出显示了一行中的一部分,错误开始于:(t,e)};function o(t,e){function r(){this.constructor=t}

Uncaught TypeError: Cannot read property 'Identifiers' of undefined at c (platform-browser-dynamic.umd.min.js:28)

它突出显示从标识符到行尾(不是粘贴整行):var p=function c(){var e=new Map;return e.set(t.Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS

还有一些,但这是我所反对的一个很好的例子(我认为)。我只是不明白为什么我会得到这些,我可能做错了什么导致了这个。而且我还认为这就是插值效果不佳的原因(例如,我只是看到 {{name}})。

如果有任何进一步的信息可以帮助解决这个问题,请告诉我。

谢谢。

引用 rxjs cdn 首先解决了平台浏览器动态错误以外的所有错误,该错误通过为 angular 编译器添加 cdn 解决