Module "Users/../node_modules/react-router" has no exported member 'match'

Viewed 1939

I upgraded react-router and react-router-dom to 6.0.0-beta.0 from v4 and since then I'm getting this error. I'm not using match.path anywhere in the app.

dependencies {
 "@types/react-router": "^4.0.28",
 "@types/react-router-dom": "^4.2.7",
 "react-router": "^6.0.0-beta.0",
 "react-router-dom": "^6.0.0-beta.0",
 "history": "^5.0.0"
}
/Users/..../../node_modules/@types/react-router-dom/index.d.ts
(10,10): Module '"../../../../../../../../Users/allans/Desktop/../../node_modules/react-router"' has no exported member 'match'

Not enough documentation is available to this issue.

3 Answers

remove @types/react-router and @types/react-router-dom from package.json

For me, this error was resolved by removing react-router from package.json and keeping react-router dom only

I did some research and according to this post! looks like we do not require @types/react-router and @types/react-router-dom in package.json file.

Related