Error when upgrading antd version 4 to version 5

132 views Asked by At

When upgrading ant version 4 to version 5 following antd document, I got these errors related to less file:

error  in ./src/pages/user/Login/index.less?modules

Module build failed (from ./node_modules/@umijs/bundler-webpack/lib/webpack/plugins/mini-css-extract-plugin/src/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/@umijs/deps/compiled/less-loader/cjs.js):


  overflow: auto;
  background: @layout-body-background;
            ^
Variable @layout-body-background is undefined
  

 error  in ./src/pages/user/ResetPassword/index.less?modules

Module build failed (from ./node_modules/@umijs/bundler-webpack/lib/webpack/plugins/mini-css-extract-plugin/src/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/@umijs/deps/compiled/less-loader/cjs.js):


  overflow: auto;
  background: @layout-body-background;
            ^
Variable @layout-body-background is undefined
      

 error  in ./src/global.less

How can I solve it?

0

There are 0 answers