antd-dayjs-webpack-plugin icon indicating copy to clipboard operation
antd-dayjs-webpack-plugin copied to clipboard

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

Open gctcxu opened this issue 4 years ago • 10 comments

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

gctcxu avatar Feb 06 '21 04:02 gctcxu

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

iamkun avatar Feb 06 '21 06:02 iamkun

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

gctcxu avatar Feb 06 '21 13:02 gctcxu

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

iamkun avatar Feb 06 '21 13:02 iamkun

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

gctcxu avatar Feb 06 '21 17:02 gctcxu

you can try to use it with no config, just

plugins: [
    new AntdDayjsWebpackPlugin()
  ]

iamkun avatar Feb 07 '21 02:02 iamkun

you can try to use it with no config, just

plugins: [
    new AntdDayjsWebpackPlugin()
  ]

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

gctcxu avatar Feb 07 '21 03:02 gctcxu

well a reproduction demo, please

iamkun avatar Feb 07 '21 05:02 iamkun

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.

KrishnaPG avatar May 04 '21 03:05 KrishnaPG

How to fix it

fancymo avatar Oct 26 '21 06:10 fancymo

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?

congxiaoyang avatar Mar 29 '22 09:03 congxiaoyang