Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Angular 11.1.x #6366

Closed
Airblader opened this issue Jan 22, 2021 · 4 comments
Closed

Support Angular 11.1.x #6366

Airblader opened this issue Jan 22, 2021 · 4 comments

Comments

@Airblader
Copy link
Collaborator

Reproduction link

(Irrelevant)

Steps to reproduce

Update a project using ng-zorro-antd to Angular 11.1.

What is expected?

It works. :-)

What is actually happening?

A bunch of errors in ng-zorro-antd's theme:

Error: ./src/main.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) Error: Module build failed (from ./node_modules/less-loader/dist/cjs.js):


@input-padding-vertical-base: max(
  round((@input-height-base - @font-size-base * @line-height-base) / 2 * 10) / 10 -
^
Error evaluating function `round`: argument must be a number
      Error in node_modules/ng-zorro-antd/style/themes/default.less (line 391, column 2)
    at /path/ro/repo/node_modules/webpack/lib/NormalModule.js:313:13
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /path/ro/repo/node_modules/@ngtools/webpack/src/ivy/loader.js:57:9
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
 @ multi ./src/main.ts main[0]

Error: ./src/polyfills.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) Error: Module build failed (from ./node_modules/less-loader/dist/cjs.js):


@input-padding-vertical-base: max(
  round((@input-height-base - @font-size-base * @line-height-base) / 2 * 10) / 10 -
^
Error evaluating function `round`: argument must be a number
91m      Error in node_modules/ng-zorro-antd/style/themes/default.less (line 391, column 2)
    at /path/ro/repo/node_modules/webpack/lib/NormalModule.js:313:13
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /path/ro/repo/node_modules/@ngtools/webpack/src/ivy/loader.js:57:9
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
 @ multi ./node_modules/@angular-devkit/build-angular/src/webpack/es5-polyfills.js zone.js/dist/zone-legacy ./src/polyfills.ts polyfills-es5[2]

Error: ./node_modules/zone.js/dist/zone-legacy.js
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) Error: Module build failed (from ./node_modules/less-loader/dist/cjs.js):


@input-padding-vertical-base: max(
  round((@input-height-base - @font-size-base * @line-height-base) / 2 * 10) / 10 -
^
Error evaluating function `round`: argument must be a number
      Error in node_modules/ng-zorro-antd/style/themes/default.less (line 391, column 2)
    at /path/ro/repo/node_modules/webpack/lib/NormalModule.js:313:13
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /path/ro/repo/node_modules/@ngtools/webpack/src/ivy/loader.js:57:9
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
 @ multi ./node_modules/@angular-devkit/build-angular/src/webpack/es5-polyfills.js zone.js/dist/zone-legacy ./src/polyfills.ts polyfills-es5[1]

Error: ./node_modules/@angular-devkit/build-angular/src/webpack/es5-polyfills.js
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) Error: Module build failed (from ./node_modules/less-loader/dist/cjs.js):


@input-padding-vertical-base: max(
  round((@input-height-base - @font-size-base * @line-height-base) / 2 * 10) / 10 -
^
Error evaluating function `round`: argument must be a number
      Error in node_modules/ng-zorro-antd/style/themes/default.less (line 391, column 2)
    at /path/ro/repo/node_modules/webpack/lib/NormalModule.js:313:13
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /path/ro/repo/node_modules/@ngtools/webpack/src/ivy/loader.js:57:9
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
 @ multi ./node_modules/@angular-devkit/build-angular/src/webpack/es5-polyfills.js zone.js/dist/zone-legacy ./src/polyfills.ts polyfills-es5[0]
m
Error: ./src/styles.less
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/less-loader/dist/cjs.js):


// ================================================================
.table-size(~'middle', @table-padding-vertical-md, @table-padding-horizontal-md, @table-font-size-md);
^
Cannot read property 'numerator' of undefined
      Error in node_modules/ng-zorro-antd/table/style/size.less (line 53, column 0)
    at /path/ro/repo/node_modules/webpack/lib/NormalModule.js:316:20
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/path/ro/repo/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.lessLoader (/path/ro/repo/node_modules/less-loader/dist/index.js:57:5)
 @ multi ./src/styles.less styles[0]

Error: ./src/styles.less (./node_modules/css-loader/dist/cjs.js??ref--14-1!./node_modules/postcss-loader/dist/cjs.js??ref--14-2!./node_modules/less-loader/dist/cjs.js??ref--14-3!./src/styles.less)
Module build failed (from ./node_modules/less-loader/dist/cjs.js):


// ================================================================
.table-size(~'middle', @table-padding-vertical-md, @table-padding-horizontal-md, @table-font-size-md);
^
Cannot read property 'numerator' of undefined
      Error in node_modules/ng-zorro-antd/table/style/size.less (line 53, column 0)
Error: 

// ================================================================
.table-size(~'middle', @table-padding-vertical-md, @table-padding-horizontal-md, @table-font-size-md);
^
Cannot read property 'numerator' of undefined
      Error in node_modules/ng-zorro-antd/table/style/size.less (line 53, column 0)
    at Object.lessLoader (/path/ro/repo/node_modules/less-loader/dist/index.js:57:14)

Environment Info
ng-zorro-antd 11.0.2
Browser Irrelevant
@Airblader
Copy link
Collaborator Author

CC @nicoweidner @sorahn

@vthinkxie
Copy link
Member

Hi @Airblader
it should be fixed via #6365

@vthinkxie
Copy link
Member

you can downgrade less to 3.x as a temp solution
duplicated of #6359

@Airblader
Copy link
Collaborator Author

Sorry, should've looked at the PRs first. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants