-
Notifications
You must be signed in to change notification settings - Fork 30
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
date.localeData is not a function #36
Comments
请提供一个复现demo或repo |
我上面有CodeSandbox链接啊 |
不好意思 看到链接了 |
比较神奇 我CodeSandbox在线看 是有这个问题,但打包成 zip 到本地跑 就是好的 |
在本地跑也有这个问题哈 |
@moshuchao 可以提供一个 github repo 吗 |
我真不明白了,为什么还要GitHub repo,我本地跑的也是从codesandbox导出的压缩包,一毛一样的重现。别告诉我这个是机器人。 |
@moshuchao 升级下 dayjs, 我升到 |
@urielvan 谢谢 我试了下 果然是这个问题, CodeSandbox 严格锁版本的, 我本地全局装的是最新版本 dayjs 已经修复这个问题了。 |
我也遇到了这样的问题,升级了dayjs的版本也没有用啊 |
please check if you have two dayjs node modules inside node_modules |
@iamkun |
@iamkun 我找到了你之前的解决方法,删除了package-lock.json,重新npm i 了一下,rc-picker更新了,问题解决了!感谢🙏 |
我也是删了yarn.lock重装就好了,感觉不太好,但不知道是哪个组件依赖了他,重装那个组件就好 |
|
|
@iamkun |
Maybe it related to how npm resolve or the order you install packages. npm can not identity two version of dayjs can be shared if you do not install them in one shot |
In my current project, this problem will occur if the version of dayjs that rc-pick depends on is different from the version of dayjs in the project itself. Do you know the principle? |
Try the following code, which seems to be caused by rc-picker import localeData from 'dayjs/plugin/localeData';
import dayjs from 'dayjs';
dayjs.extend(localeData); |
Faced with this issue, didn't find a solution, so replaced ant-design DatePicker with a component from another package |
I get this problem twice when i update my project, my project is pnnpm monorepo, |
v4.23.6 still get this problem, after some research I finally get what happen.
How it work
SolutionIf you have set
Demo |
did you find any solution in this or still using react date-picker? |
Reproduction link
Steps to reproduce
What is expected?
修复bug或者告诉我怎么样绕过去
What is actually happening?
Uncaught TypeError: date.localeData is not a function
The text was updated successfully, but these errors were encountered: