ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

[DatePicker]: Moment.isMoment is not a function

Open nooooooom opened this issue 3 years ago • 5 comments
trafficstars

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.7.7

Environment

Windows10, Chrome 102.0.5005.115, Vue 2.6.14

Reproduction link

https://github.com/vueComponent/ant-design-vue/blob/acaad271351ca0966f828fd323ecfa05cefe6537/components/_util/moment-util.js#L2

Steps to reproduce

Start with vite.

What is expected?

DatePicker working well.

What is actually happening?

An error has occurred, It's described as moment.isMoment is not a function.


The moment 2.21.0 doesn't support es module export, so import * as XX will have an error.

nooooooom avatar Jul 05 '22 12:07 nooooooom

image image

nooooooom avatar Jul 05 '22 12:07 nooooooom

This question is a duplicate, but was never addressed.

nooooooom avatar Jul 05 '22 12:07 nooooooom

For 1.x, we not change this. you can try use alias moment-util.js to new file.

tangjinzhou avatar Jul 05 '22 14:07 tangjinzhou

For 1.x, we not change this. you can try use alias moment-util.js to new file.

Thanks, this helps me solve the problem.

nooooooom avatar Jul 07 '22 10:07 nooooooom

@nooooooom you can try my plugin vite-plugin-antdv-fix

moliyu avatar Sep 03 '22 01:09 moliyu

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Nov 02 '22 03:11 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 11 '23 00:11 github-actions[bot]