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

"moment_1.default.locale" is not a function #2

Closed
snowbagoly opened this issue Sep 8, 2021 · 1 comment
Closed

"moment_1.default.locale" is not a function #2

snowbagoly opened this issue Sep 8, 2021 · 1 comment

Comments

@snowbagoly
Copy link

First of all, thank you for maintaining this project!

I have bumped into the issue that we cannot use the library with our configuration as it throws this error in the browser for the BaseInput.js, when I add a DateInput:

moment_1.default.locale is not a function

I've found that the problem might be with the moment version, I've set it to 2.24.0 explicitly, but it didn't solve the problem. I've also seen in this thread that the settings

"esModuleInterop": true,
"allowSyntheticDefaultImports": true

in the tsconfig.json might help, but no luck. We are using TypeScript v4.3.2. Have you maybe encountered this issue?

@zheyujie
Copy link
Owner

Hi @snowbagoly, I've not encountered this problem before...
The tsconfig for this library already has allowSyntheticDefaultImports set to true.

Have you tried pulling this library, change the way it imports moment to import * as moment from 'moment' and see if it helps?
You should be able to use npm link or yarn link to link this library to your project locally to test it.

@zheyujie zheyujie closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2022
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

No branches or pull requests

2 participants