【发布时间】:2022-03-24 16:39:37
【问题描述】:
我设置了新的 Typescript/React 项目,在 tsconfig.json 文件中收到此错误消息
"找不到 'bson' 的类型定义文件。 该文件在程序中,因为: 隐式类型库 'bson' 的入口点"
任何想法。
这是我的 tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
【问题讨论】:
-
请发布您的 tsconfig.json 文件和任何其他可能相关的代码
-
添加了请看。
标签: reactjs typescript next.js eslint