NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.81k stars 3.86k forks source link

请问12版本less编译报错问题如何解决? #7117

Closed 13776668267 closed 2 years ago

13776668267 commented 2 years ago

Reproduction link

[]

Steps to reproduce

angular9升级到12,然后升级ng-zorro-antd到12,ng build编译APP ./themes/default/index.less - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/less-loader/dist/cjs.js):

// ================================================================ .table-size(~'middle', @table-padding-vertical-md, @table-padding-horizontal-md, @table-font-size-md); ^ Operation on an invalid type Error in D:\idesign\angular12-dev\idesign-app-platform\node_modules\ng-zorro-antd\table\style\size.less (line 39, column 0) at processResult (D:\idesign\angular12-dev\idesign-app-platform\node_modules\webpack\lib\NormalModule.js:713:19) at D:\idesign\angular12-dev\idesign-app-platform\node_modules\webpack\lib\NormalModule.js:819:5 at D:\idesign\angular12-dev\idesign-app-platform\node_modules\loader-runner\lib\LoaderRunner.js:399:11 at D:\idesign\angular12-dev\idesign-app-platform\node_modules\loader-runner\lib\LoaderRunner.js:251:18 at context.callback (D:\idesign\angular12-dev\idesign-app-platform\node_modules\loader-runner\lib\LoaderRunner.js:124:13) at Object.lessLoader (D:\idesign\angular12-dev\idesign-app-platform\node_modules\@angular-devkit\build-angular\node_modules\less-loader\dist\index.js:54:5)

What is expected?

解决方法

What is actually happening?

编译失败

Environment Info
ng-zorro-antd 12.0.2
Browser chrome
zorro-bot[bot] commented 2 years ago

Translation of this issue:

How can the 12 version of the LESS compilation error problem?

reproduction link

[]

steps to reproduce

Angular9 upgrade to 12, then upgrade NG-Zorro-ANTD to 12, NG Build Compile App APP ./themes/default/index.less - error: Module Build Faird (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuilderror: Module Build Faled (from ./node_modules/@angular-devkit/build- directly/node_modules/less-loader/dist/cjs.js):

/ / =================================================== ================= .Table-size, @ Table-padding-vertical-md, @ Table-Padding-horizontal-md, @ Table-Font-Size-MD); ^ Operation ON An Invalid Type ERROR IN D: \ IDESIGN \ Angular12-Dev \ Idesign-App-Platform \ Node_Modules \ Ng-Zorro-ANTD \ TABLE \ Style \ Size.less (Line 39, Column 0) AT ProcessResult (D: \ IDESIGN \ Angular12-Dev \ Idesign-App-Platform \ Node_Modules \ Webpack \ Lib \ NormalModule.js: 713: 19) AT D: \ IDESIGN \ Angular12-Dev \ Idesign-App-Platform \ Node_Modules \ WebPack \ Lib \ NormalModule.js: 819: 5 AT D: \ IDESIGN \ Angular12-Dev \ Idesign-App-Platform \ Node_Modules \ Loader-Runner \ Lib \ Loaderrunner.js: 399: 11 AT D: \ IDESIGN \ Angular12-Dev \ Idesign-App-Platform \ Node_Modules \ Loader-Runner \ Lib \ LoaderRunner.js: 251: 18 AT Context.callback (D: \ IDESIGN \ Angular12-Dev \ Idesign-App-Platform \ Node_Modules \ Loader-Runner \ Lib \ Loaderrunner.js: 124: 13) AT Object.LESSLOADER (D: \ IDESIGN \ Angular12-Dev \ Idesign-App-Platform \ Node_Modules \ @ Angular-Devkit \ Build-Angular \ DIDE_MODULES \ Less-loader \ Dist \ Index.js: 54: 5)

What is expected?

Solution

What is actually happens?

Compilation failed

ENVIRONMENT INFO
Ng-Zorro-ANTD 12.0.2
Browser Chrome
simplejason commented 2 years ago

建议逐版本升级,并参考 angular 与 ng-zorro-antd 升级文档

no-response[bot] commented 2 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. If you can provide more information, feel free to ping anyone of our maintainers to reopen this issue. Thank you for your contributions. --- 这个 issue 已经被自动关闭,因为您没有向我们提供更多的信息。仅凭目前的描述我们无法采取任 何行动,如果您能提供更多的信息请随时联系我们的开发人员重新打开这个 issue。 感谢您的贡献。