react-idle-timer: Build fails due to missing dev dependency
Bug information
Affected Module
Version: 5.0.0
Describe the bug
Build fails with this message:
❯ yarn build
yarn run v1.22.17
$ tsc && vite build
../node_modules/react-idle-timer/dist/withIdleTimer.d.ts:2:26 - error TS2307: Cannot find module 'utility-types' or its corresponding type declarations.
2 import { Subtract } from 'utility-types';
~~~~~~~~~~~~~~~
Found 1 error in ../node_modules/react-idle-timer/dist/withIdleTimer.d.ts:2
error Command failed with exit code 2.
To Reproduce
Steps to reproduce the behavior:
- Build it in a project (with Vite?)
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System Information (please complete the following information)
OS: UbuntuDevice: Desktop
Additional context
"node": "16.13.2",
"yarn": "1.22.17"
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (9 by maintainers)
Commits related to this issue
- 🐞 Use builtin Omit over utility-types. #249 — committed to SupremeTechnopriest/react-idle-timer by SupremeTechnopriest 2 years ago
@doron-cohen @mmichael0413 @ChrisZieba,
Published
5.1.3to NPM. Now uses builtinOmitover utility-typesSubtract. The project no longer depends onutility-typesso you should be good to go. This is a good fix. Always like removing dependencies! Thanks for the report, feel free to re-open this if you are still having issues.In production you run the compiled code and types are no longer needed so it should be fine. I will just remove utility types and use the typescript built ins.
Fixed it for me. Thank you so much for the quick response and fix!
Interestingly, I’m also seeing this error. Not too sure what the problem is yet.