我尝试使用redux-undo v1.0.0-beta9-9-6并从TypeScript中收到以下错误:
MY_PROJECT / node_modules /终极版-撤消/ typings.d.ts (14,15):错误TS2300:重复的标识符' FilterFunction'。
我已查看typings.d.ts文件,但似乎不是另一个标识符FilterFunction
。
但是,我知道我有一个本地依赖,它也使用redux-undo
。我正在使用npm link
链接到我的依赖项目。从技术上讲,在我的node_modules
文件夹中,typings.d.ts
有两个redux-undo
:
/node_modules/redux-undo
,
/node_modules/my_dependency_module/node_modules/redux-undo
。
我怀疑这可能是问题......这是tsconfig.json
:
{
"compilerOptions": {
"outDir": "build/dist",
"module": "commonjs",
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"typeRoots": [
"node_modules/@types"
],
"baseUrl": ".",
"paths": {
"react": ["node_modules/@types/react"],
"react-redux": ["node_modules/@types/react-redux"],
"react-dom": ["node_modules/@types/react-dom"],
"react-dnd": ["node_modules/@types/react-dnd"],
"react-dnd-html5-backend": ["node_modules/@types/react-dnd-html5-backend"],
"react-split-pane": ["node_modules/@types/react-split-pane"]
}
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts",
"./node_modules/datavoyager/node_modules/redux-undo/typings.d.ts"
],
"include": [
"./typings/*.d.ts",
"./src/**/*"
],
"types": [
"typePatches"
]
}
此外,似乎没有我可以安装的任何@types/redux-undo
包。否则我会尝试。
答案 0 :(得分:0)
在我的renda['age'].mean()
paths
后问题消失了
tsconfig.json