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

Error: cannot find module @date-io/core/IUtils #1

Closed
nzacca opened this issue Nov 7, 2018 · 8 comments
Closed

Error: cannot find module @date-io/core/IUtils #1

nzacca opened this issue Nov 7, 2018 · 8 comments

Comments

@nzacca
Copy link

nzacca commented Nov 7, 2018

Hello!

Nice refactor! I'm encountering the following error after updating.

ERROR in /<truncated>/node_modules/@date-io/moment/build/moment-utils.d.ts(2,24):
TS2307: Cannot find module '@date-io/core/IUtils'.
ERROR in /<truncated>/node_modules/material-ui-pickers/_shared/BasePicker.d.ts(1,24):
TS2307: Cannot find module '@date-io/core/IUtils'.
ERROR in /<truncated>/node_modules/material-ui-pickers/_shared/WithUtils.d.ts(1,24):
TS2307: Cannot find module '@date-io/core/IUtils'.

I was able to workaround the issue by manually installing the core package but I was wondering if perhaps it should be included as a dependency of the moment/date-fns/etc. packages instead?

This is where the problem is (which goes away after installing core):
https://github.com/dmtrKovalenko/date-io/blob/master/packages/moment/src/moment-utils.ts#L2

@dmtrKovalenko
Copy link
Owner

@nzacca you are using typescript?

@nzacca
Copy link
Author

nzacca commented Nov 7, 2018

@dmtrKovalenko Yes. v3.1.6

@tjaskula
Copy link

tjaskula commented Nov 7, 2018

I have the same problem with TS

@dmtrKovalenko
Copy link
Owner

Published in v0.0.2 with the fix

@ahce
Copy link

ahce commented Apr 19, 2019

@dmtrKovalenko this issue came back in v1.2.0

@ee0pdt
Copy link

ee0pdt commented May 16, 2019

Can confirm, this is a live issue

"@date-io/moment": "^1.3.5",

(2,24): Cannot find module '@date-io/core/IUtils'.

@seanmccay
Copy link

I'm having this issue as well.

"typescript": "^3.3.4000"
"@date-io/moment": "^1.1.0"
"moment": "^2.22.2",

node_modules/@date-io/moment/build/moment-utils.d.ts:2:24 - error TS2307: Cannot find module '@date-io/core/IUtils'.

2 import { IUtils } from "@date-io/core/IUtils";
~~~~~~~~~~~~~~~~~~~~~~

node_modules/material-ui-pickers/MuiPickersUtilsProvider.d.ts:1:24 - error TS2307: Cannot find module '@date-io/core/IUtils'.

1 import { IUtils } from '@date-io/core/IUtils';
~~~~~~~~~~~~~~~~~~~~~~

node_modules/material-ui-pickers/_shared/BasePicker.d.ts:3:24 - error TS2307: Cannot find module '@date-io/core/IUtils'.

3 import { IUtils } from '@date-io/core/IUtils';
~~~~~~~~~~~~~~~~~~~~~~

node_modules/material-ui-pickers/_shared/WithUtils.d.ts:1:24 - error TS2307: Cannot find module '@date-io/core/IUtils'.

1 import { IUtils } from '@date-io/core/IUtils';

@nzacca
Copy link
Author

nzacca commented May 16, 2019

Issue was introduced here: e0dfb67#diff-3c70df024fb0ca5df014877fa49bcc08L12

May be able to use a type import (ex. import("@date-io/core").IUtils) instead since it is only used to grab the IUtils type def.

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

Successfully merging a pull request may close this issue.

6 participants