react-component/picker

TypeError: Cannot read properties of null (reading 'deoptimizeArgumentsOnInteractionAtPath') when build with vite

ag-import opened this issue · 2 comments

I use in my project:

"antd": "^5.2.3",
"vite": "^4.1.4",

antd uses "rc-picker": "~3.1.1", under the hood. Current installed version of rc-picker is 3.1.5.
image

vite uses "rollup": "^3.10.0" under the hood. Current installed version of rollup is 3.19.1.
image

I use @vitejs/plugin-react (latest 3.1.0 version), except that the build config is default.

When I run vite build I get TypeError: Cannot read properties of null (reading 'deoptimizeArgumentsOnInteractionAtPath').

I added some console.log into deoptimizeArgumentsOnInteractionAtPath to detect the failing module
image
and got: node_modules/antd/node_modules/rc-picker/es/generate/dayjs.js.
image

I faced the issue for the second time in another project...
Something with dayjs plugins imports inside rc-picker

Shouldn't dayjs plugins for es rc-picker be imported from dayjs/esm/plugins instead of dayjs/plugins?
image