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

使用了套件之後 a-date-picker 會壞掉 #57

Open
gctcxu opened this issue Feb 6, 2021 · 10 comments
Open

使用了套件之後 a-date-picker 會壞掉 #57

gctcxu opened this issue Feb 6, 2021 · 10 comments

Comments

@gctcxu
Copy link

gctcxu commented Feb 6, 2021

  1. 已經在vue.config.js做設定
  • image
  1. 在date-picker顯示會有問題, 全部都是同一天
  • image
@iamkun
Copy link
Collaborator

iamkun commented Feb 6, 2021

please you are using the correct preset for antd4 or antd 3

@gctcxu
Copy link
Author

gctcxu commented Feb 6, 2021

please you are using the correct preset for antd4 or antd 3

I try to add preset 'antd' to argument to this plugin, but got ame result

image

@iamkun
Copy link
Collaborator

iamkun commented Feb 6, 2021

please make sure you are using antd4 if you are using this config

@gctcxu
Copy link
Author

gctcxu commented Feb 6, 2021

please make sure you are using antd4 if you are using this config

Hey, this is my package.json.lock configuration. It is v4 version
image

relat plugin setting: antd v4, ant-vue 2
image

@iamkun
Copy link
Collaborator

iamkun commented Feb 7, 2021

you can try to use it with no config, just

plugins: [
    new AntdDayjsWebpackPlugin()
  ]

@gctcxu
Copy link
Author

gctcxu commented Feb 7, 2021

you can try to use it with no config, just

plugins: [
    new AntdDayjsWebpackPlugin()
  ]

This is the first my setting, please refer to first comment

@iamkun
Copy link
Collaborator

iamkun commented Feb 7, 2021

well a reproduction demo, please

@KrishnaPG
Copy link

Same problem. Getting below error:

moment.js:6 Uncaught TypeError: moment__WEBPACK_IMPORTED_MODULE_0___default(...) is not a function
    at Object.getNow (moment.js:6)
    at postState (PickerPanel.js:123)
    at useControlledState (useMergedState.js:28)
    at PickerPanel (PickerPanel.js:119)
    at renderWithHooks (react-dom.development.js:15015)
    at mountIndeterminateComponent (react-dom.development.js:17841)
    at beginWork (react-dom.development.js:19079)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3942)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3991)
    at invokeGuardedCallback (react-dom.development.js:4053)
    at beginWork$1 (react-dom.development.js:23994)
    at performUnitOfWork (react-dom.development.js:22806)
    at workLoopSync (react-dom.development.js:22737)
    at renderRootSync (react-dom.development.js:22700)
    at performSyncWorkOnRoot (react-dom.development.js:22323)
    at react-dom.development.js:11357
    at unstable_runWithPriority (react.development.js:2764)
    at runWithPriority$1 (react-dom.development.js:11306)
    at flushSyncCallbackQueueImpl (react-dom.development.js:11352)
    at flushSyncCallbackQueue (react-dom.development.js:11339)
    at discreteUpdates$1 (react-dom.development.js:22450)
    at discreteUpdates (react-dom.development.js:3753)
    at dispatchDiscreteEvent (react-dom.development.js:5919)

For some reason, the rc-picker/es/generate/moment.js is being invoked (instead of the dayjs version and getting this error.

@fancymo
Copy link

fancymo commented Oct 26, 2021

How to fix it

@congxiaoyang
Copy link

you can try to use it with no config, just

plugins: [
    new AntdDayjsWebpackPlugin()
  ]

This is the first my setting, please refer to first comment

Is this problem solved please?

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

5 participants