question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS2307 Cannot find module '@date-io/type'

See original GitHub issue

cry

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

  1. create a project with ts and react

  2. install @material-ui/picker

  3. use the DatePicker with the provider and try to build it

  4. 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 🤣!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:30 (21 by maintainers)

github_iconTop GitHub Comments

7reactions
hwatersivcommented, Oct 15, 2019

im getting this too with @date-io/luxon

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';
                           ~~~~~~~~~~~~~~~

node_modules/@material-ui/pickers/views/Year/YearView.d.ts:2:26 - error TS2307: Cannot find module '@date-io/type'.

2 import { DateType } from '@date-io/type';
                           ~~~~~~~~~~~~~~~

please resolve

3reactions
dmtrKovalenkocommented, Jul 5, 2019

Closing that. Here is a repo where auto-linked @date-io/type module works like a charm

yarn tsc succed

Read more comments on GitHub >

github_iconTop Results From Across the Web

TS2307 Cannot find module '@date-io/type' · Issue #1074
How to fix it. From what i saw the type DateType does not exist on @date-io/type (because @date-io ...
Read more >
tsc throws `TS2307: Cannot find module` for a local file
ts(5,20): error TS2307: Cannot find module 'components/button'. It complains about all imports of local files, like the following: import Counter from ' ...
Read more >
How to import my own module from a test file? : r/typescript
I'm working on a node package but can't seem to figure out how to import said package from the test ... r/typescript •...
Read more >
ReactJS
He guys, please I need some help with my NextJS/NodeJS project. I'm having the error: TypeError: Cannot read property '_id' of undefined at...
Read more >
DesktopDatePicker API - MUI X
Name Type Default onChange * func renderInput * func acceptRegex RegExp /\dap/gi
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found