Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running npm run lint react-router #43780

Closed
aaronbeall opened this issue Apr 9, 2020 · 2 comments
Closed

Error when running npm run lint react-router #43780

aaronbeall opened this issue Apr 9, 2020 · 2 comments

Comments

@aaronbeall
Copy link
Contributor

I don't know if this is an issue with my local environment but when I try to run npm run lint react-router (or for other React related libraries) I get this error:

Error: Errors in typescript@3.9 for external dependencies:
../react/index.d.ts(36,22): error TS2307: Cannot find module 'csstype' or its corresponding type declarations.

I tried this with a fresh clone of DT as well as with my own fork. I noticed that the CI build doesn't seem to have this issue.

@aaronbeall
Copy link
Contributor Author

I figured it out. react is imported by react-router (not surprisingly) which is defined in DT, so comes from types/react, and types/react has it's own package.json that lists csstype as an external dependency (not in DT). I needed to npm install from types/react to get the full dependencies for react-router. This makes sense now, but it was a bit of a surprise.

@davidje13
Copy link
Contributor

For future people finding this issue (like me!), the same error message is currently appearing when using @types/react in a project due to a mistake in 16.14.1, fixed in #49717 (not yet published). In the meantime, downgrading to @types/react@16.14.0 fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants