0

Problem

I'm trying to use redux-undo v1.0.0-beta9-9-6 and have the following error from TypeScript:

My_Project/node_modules/redux-undo/typings.d.ts (14,15): error TS2300: Duplicate identifier 'FilterFunction'.

My Attempts

(1)

I've checked the typings.d.ts file, there doesn't seem to be another identifier FilterFunction.

(2)

However, I know I have one local dependency that also uses redux-undo. I am using npm link to link to my dependency project. So technically in my node_modules folder, there are two typings.d.ts for redux-undo:

/node_modules/redux-undo,

/node_modules/my_dependency_module/node_modules/redux-undo.

I suspect this might be the problem... Here's my 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"
  ]
}

(3)

Also, there doesn't seem to be any @types/redux-undo package that I can install. Otherwise I would try.

1 Answer 1

0

Problem gone after I add the following line to paths in my tsconfig.json:

"redux-undo": ["node_modules/redux-undo"]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.