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

TS2307 Cannot find module 'moment/min/moment-with-locales' #5578

Closed
sergeyshmakov opened this issue Jun 2, 2020 · 2 comments
Closed

TS2307 Cannot find module 'moment/min/moment-with-locales' #5578

sergeyshmakov opened this issue Jun 2, 2020 · 2 comments

Comments

@sergeyshmakov
Copy link

Describe the bug
Cannot import moment/min/moment-with-locales because of Typescript error.

To Reproduce
Open any project with latest Typescript
Type import moment from "moment/min/moment-with-locales";
Run tsc
See the error TS2307 Cannot find module 'moment/min/moment-with-locales'

Expected behavior
Import without error with full types support.

Screenshots
image

image

Without any types definitions:

image

Version:

  • From 2.25.0 to 2.26.0

The last working version for this bug is 2.24.0

#4946

@Alanscut
Copy link
Contributor

I use require and it will no longer report an error and work very well, but I don’t understand why this phenomenon exists. can someone tell this problem? Thanks in advance!

const moment = require('moment/min/moment-with-locales');

@marwahaha
Copy link
Member

You may want to ask on StackOverflow.

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

No branches or pull requests

3 participants