Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

antd 5 Module not found: Error: Can't resolve 'antd/dist/antd.less'

I’ve updated antd to 5.0.0. I’ve these imports which are giving error now.

@import '~antd/es/style/themes/default.less';
@import '~antd/dist/antd.less';

what should I replace with in new versions?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

From v4 to v5, antd css files are no longer included in package.

Since CSS-in-JS supports importing on demand, the original antd/dist/antd.css has also been abandoned.

If you need to reset some basic styles, please use import antd/dist/reset.css. So just delete these codes if you don’t need to reset bacis styles.

refrence: https://ant.design/docs/react/migration-v5

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading