【发布时间】:2021-04-20 15:08:33
【问题描述】:
我正在使用一个依赖于 isomorphic-unfetch 的依赖项。 在 Angular 11 项目中,我可以执行 isomorphic-unfetch 本身而不会出现任何错误。 当使用内部使用 isomorphic-unfetch 来获取的依赖项(通过 npm 安装)时,我收到以下消息:
index.js:209 TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
at zone-evergreen.js:1465
at Object.proto.<computed> [as default] (zone-evergreen.js:975)
at index.js:189
at step (index.js:70)
at Object.next (index.js:51)
at index.js:44
at new ZoneAwarePromise (zone-evergreen.js:1387)
at __awaiter (index.js:40)
at index.js:380
当集成到 React 或纯 JS/TS 中时,依赖项工作正常。 我在这里发现了一些相关的问题,这些问题并没有专门针对 Angular。
【问题讨论】:
标签: angular typescript npm fetch isomorphic-fetch-api