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

@types/react-wait not included in dependencies #661

Closed
rkostrzewski opened this issue Oct 9, 2019 · 1 comment
Closed

@types/react-wait not included in dependencies #661

rkostrzewski opened this issue Oct 9, 2019 · 1 comment
Labels

Comments

@rkostrzewski
Copy link
Contributor

rkostrzewski commented Oct 9, 2019

What is the current behavior?

TypeScript build fails with error:

node_modules/react-use/lib/useWait.d.ts:1:33 - error TS7016: Could not find a declaration file for module 'react-wait'. 

'....../node_modules/react-wait/dist/react-wait.js' implicitly has an 'any' type.
  Try `npm install @types/react-wait` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-wait';`

1 import { useWait, Waiter } from 'react-wait';
                                  ~~~~~~~~~~~~

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below:

echo '{}' > package.json && \
  npm i typescript react-use@latest && \
  echo "import { useWait } from 'react-use'; console.log(useWait);" && \
  npx tsc --init && \
  npx tsc --noEmit

What is the expected behavior?

Contrary to the expected some TypeScript types should be included as dependencies. This is the case with react-wait on which typings for node_modules/react-use/lib/useWait.d.ts depend (so it should indeed be included as dependency, not devDependency). More on that can be found in TypeScript handbook.

Simply reverting 49372ac should be enough to make things work again 😄

A little about versions:

rkostrzewski added a commit to rkostrzewski/react-use that referenced this issue Oct 9, 2019
streamich pushed a commit that referenced this issue Oct 10, 2019
## [12.3.1](v12.3.0...v12.3.1) (2019-10-10)

### Bug Fixes

* move [@types](https://github.com/types)/react-wait to dependencies, closes [#661](#661) ([#662](#662)) ([6bdd74e](6bdd74e))
@streamich
Copy link
Owner

🎉 This issue has been resolved in version 12.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants