我在使用 .find 方法时遇到了这种类型的错误。我知道这是一个 tsconfig.json 库问题,但我阅读了每一篇文章,但没有一个解决方案对我有用。
我尝试在lib列表中添加:es5、es2015、es6、es2016、es7、es2017、es2018、es2019等一一添加。 我也尝试将所有这些添加到目标中
我的 typescript 版本是 4.9.4
这是我的 tsconfig.json:
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": false,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
{...}
谢谢!