我正在尝试将
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
?
根据github问题修复,似乎是将
esnext
添加到lib
的tsconfig.json
数组中。
ng 添加 apollo-Angular 无法正常工作#1485
Typescript 编译过程中出现 Cannot find name 'AsyncIterator' 错误。第83章
{
"compileOnSave": false,
"compilerOptions": {
...
"target": "ES2022",
"lib": ["esnext"],
"module": "ES2022"
},
...
}