TSC error while importing 'react-router-dom' #8364
Unanswered
DiogoAmann
asked this question in
Q&A
Replies: 1 comment 4 replies
-
It sounds like you're using an old version of TypeScript. I'm not sure what our minimum is exactly, but you should be using at least 3.8 to support the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I'm trying to import the 'react-router-dom' in a React typescript solution.
I first did the "npm install react-router-dom".
Right after importing like this: import {} from 'react-router-dom' in my tsx file, the compiler triggers the following errors:
[13:19:44] Error - [tsc] node_modules/react-router-dom/index.d.ts(3,13): error TS1005: '=' expected.
[13:19:44] Error - [tsc] node_modules/react-router-dom/index.d.ts(3,25): error TS1005: ';' expected.
[13:19:44] Error - [tsc] node_modules/react-router-dom/index.d.ts(5,1): error TS1128: Declaration or statement expected.
[13:19:44] Error - [tsc] node_modules/react-router-dom/index.d.ts(5,13): error TS1005: ';' expected.
[13:19:44] Error - [tsc] node_modules/react-router-dom/index.d.ts(5,283): error TS1005: ';' expected.
[13:19:44] Error - [tsc] node_modules/react-router/index.d.ts(2,13): error TS1005: '=' expected.
[13:19:44] Error - [tsc] node_modules/react-router/index.d.ts(2,64): error TS1005: ';' expected.
[13:19:44] Error - [tsc] node_modules/react-router/index.d.ts(4,1): error TS1128: Declaration or statement expected.
[13:19:44] Error - [tsc] node_modules/react-router/index.d.ts(4,13): error TS1005: ';' expected.
Does anyone have any ideas?
Thanks,
Diogo
Beta Was this translation helpful? Give feedback.
All reactions