deep-jade
deep-jade6mo ago

@refinedev/antd error

Hello, we've recently ran npm i to install packages in our dev env but we are getting the following error:
Compiled /auth/login in 34.6s (8947 modules)
node_modules/@refinedev/antd/dist/index.js (1:23364) @ Gs
TypeError: Cannot destructure property 'SubMenu' of 'he.Menu' as it is undefined.
at eval (webpack-internal:///./node_modules/@refinedev/antd/dist/index.js:1067:16)
Compiled /auth/login in 34.6s (8947 modules)
node_modules/@refinedev/antd/dist/index.js (1:23364) @ Gs
TypeError: Cannot destructure property 'SubMenu' of 'he.Menu' as it is undefined.
at eval (webpack-internal:///./node_modules/@refinedev/antd/dist/index.js:1067:16)
5 Replies
kapa.ai
kapa.ai6mo ago
Hi @bombillazo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The error message you're seeing seems to be related to a destructuring issue with 'SubMenu' of 'he.Menu' in the '@refinedev/antd' package. However, the information extracts provided do not contain specific details about this error. That being said, some users have reported similar compile errors after upgrading from @refinedev/antd@3.x.x to @refinedev/antd@4.x.x and have provided some solutions. You could try the following steps: Solution 1 1. Remove node_modules folder 2. Remove package-lock.json file 3. Run npm install Solution 2 Run the following command to install the latest versions of react and react-dom:
npm install react@latest react-dom@latest
npm install react@latest react-dom@latest
You can find more details about these solutions in the Refine documentation (https://refine.dev/docs/ui-integrations/ant-design/migration-guide/#compile-errors). If the error persists, it might be due to an issue with the cache system of your package manager. In that case, try clearing the cache and reinstalling the dependencies. You can also try installing the latest version of the '@refinedev/antd' module by running npm i @refinedev/antd@latest. If none of these solutions work, I would recommend reaching out to the Refine community on Discord (https://discord.com/channels/837692625737613362/1167394144650547200) for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@260960777010151436> kapa.ai is still learning and improving, please let us know how it did by reacting below
mute-gold
mute-gold6mo ago
Hello @bombillazo please check for typos in your project, it should be like this: const { Submenu } = Menu
deep-jade
deep-jade6mo ago
Hey, it was an issue wiht next transpiling certain dependencies
mute-gold
mute-gold6mo ago
Happy to hear that it's resolved.