ant-design-vue
ant-design-vue copied to clipboard
[DatePicker]: Moment.isMoment is not a function
- [ ] 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
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.

This question is a duplicate, but was never addressed.
For 1.x, we not change this.
you can try use alias moment-util.js to new file.
For 1.x, we not change this. you can try use alias
moment-util.jsto new file.
Thanks, this helps me solve the problem.
@nooooooom you can try my plugin vite-plugin-antdv-fix
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
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.