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

Could not find a declaration file for module 'prop-types' #316

Closed
corydeppen opened this issue Dec 17, 2017 · 7 comments
Closed

Could not find a declaration file for module 'prop-types' #316

corydeppen opened this issue Dec 17, 2017 · 7 comments

Comments

@corydeppen
Copy link
Contributor

I've created a new project using create-react-app-typescript and added the simple Formik example from the readme but I got a compile error right away:

error TS7016: Could not find a declaration file for module 'prop-types'.

I think this is due to the @types/prop-types package being included in Formik's devDependencies and not dependencies. Based on the TypeScript publishing doc, it seems like including the dependency in dependencies would be an appropriate way to manage it and should resolve this issue. Unfortunately, non-TS projects would bring down the dependency, but the alternative is requiring TS projects to manage a dependency their code doesn't depend on.

@oneillsp96
Copy link

Same issue here...

@sjsingh85
Copy link

Same issue here

@corydeppen
Copy link
Contributor Author

@jaredpalmer Would you accept a PR for this, or are you opposed to adding @types/prop-types to dependencies?

@jaredpalmer
Copy link
Owner

I guess i'd rather document it in master (right after the install instructions), and then just spend our energy moving to create-react-context so we can drop prop-types all together.

@Robinfr
Copy link

Robinfr commented Apr 6, 2018

This is still happening.

@pnoonan91
Copy link

I was able to resolve this by installing @types/prop-types

@HamidTanhaei
Copy link

same issue

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

7 participants