material-ui-pickers: TS2307 Cannot find module '@date-io/type'

Environment
| Tech | Version |
|---|---|
| @material-ui/pickers | 3.0.0 |
| material-ui | 4.0.1 |
| React | 16.8.5 |
| Browser | irrelevant |
| Peer library | date-fns@next |
Steps to reproduce
-
create a project with ts and react
-
install @material-ui/picker
-
use the DatePicker with the provider and try to build it
-
should fail
Expected behavior
My app should build 💃
Actual behavior
../../node_modules/@material-ui/pickers/DatePicker/components/YearSelection.d.ts:2:26 - error TS2307: Cannot find module '@date-io/type'.
2 import { DateType } from '@date-io/type';
~~~~~~~~~~~~~~~
../../node_modules/@material-ui/pickers/typings/date.d.ts:1:26 - error TS2307: Cannot find module '@date-io/type'.
1 import { DateType } from '@date-io/type';
~~~~~~~~~~~~~~~
How to fix it
From what i saw the type DateType does not exist on @date-io/type (because @date-io/type does not exist)
We should create this type manually instead of trying to import it from a place that doesnt exist.
Or maybe i just missed some steps or i forgot something but i hope not, it would be embarrassing 🤣!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 30 (21 by maintainers)
im getting this too with
@date-io/luxonplease resolve
Closing that. Here is a repo where auto-linked @date-io/type module works like a charm
yarn tscsuccedFor me the missing type was added after configuring the locale
The missing type comes with @date-io/moment
@rosskevin here is my package.json
For Clarity: The package is the only thing in the repo. No Im not using yarn
Closing due to silency
thats one of the first things i tried actually… ! Right now as a temporarily “fix” i added
"skipLibCheck": true,to my tsconfig file because we are using it in a project that we use at my company and we need build to pass 😄 But i’m going to look into it today or tomorrow for an alternative) because i do not want to have this options set !Here is https://github.com/dmtrKovalenko/date-io/tree/master/packages/date-fns/type
Actually one thing you need is to make
Further details are here: https://github.com/dmtrKovalenko/date-io/issues/52
Though I’ve still not been able to solve it. Ideas are welcome.
@dmtrKovalenko I am seeing the same thing with
@date-io/date-fns@1.3.7and there is no@date-io/libinstalled locally (mentioned in https://github.com/mui-org/material-ui-pickers/issues/1074#issuecomment-497763923)As far as I can tell, the only occurrence I have of this is in
node_modules/@date-io/date-fns/typeas a manual type declaration or augmentation.I’m now confused. Where is the source of
@date-io/typeand why is it referred to as a package when it is neither published nor installed as such?