为什么新的 Angular 19 应用在执行 ng add apollo-angular 时会出错?

问题描述 投票:0回答:1

我正在尝试将

apollo-angular
添加到我的 Angular 19 项目中,但我在终端中收到以下输出:

We couldn't find 'esnext.asynciterable' in the list of library files
to be included in the compilation.

It's required by '@apollo/client/core' package so please add it to your tsconfig.


We couldn't enable 'allowSyntheticDefaultImports' flag.
It's required by '@apollo/client/core' package so please add it to your tsconfig.

创建新的 Angular 19 项目后运行的命令是

ng add apollo-angular

有谁知道如何在运行时消除这些错误

ng add apollo-angular

angular typescript angular-cli apollo apollo-client
1个回答
0
投票

根据github问题修复,似乎是将

esnext
添加到
lib
tsconfig.json
数组中。

ng 添加 apollo-Angular 无法正常工作#1485

Typescript 编译过程中出现 Cannot find name 'AsyncIterator' 错误。第83章

{
  "compileOnSave": false,
  "compilerOptions": {
    ...
    "target": "ES2022",
    "lib": ["esnext"],
    "module": "ES2022"
  },
  ...
}

输出:

enter image description here

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.