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

Cannot read property 'numerator' of undefined #6359

Closed
quangquy87 opened this issue Jan 21, 2021 · 10 comments
Closed

Cannot read property 'numerator' of undefined #6359

quangquy87 opened this issue Jan 21, 2021 · 10 comments
Labels

Comments

@quangquy87
Copy link

Steps to reproduce

$ ng new PROJECT_NAME
$ cd PROJECT_NAME
$ ng add ng-zorro-antd

What is actually happening?

Error: ./src/theme.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 C:\Users\quang\Documents\PROJECT\DEMO\PROJECT-NAME\node_modules\ng-zorro-antd\table\style\size.less (line 53, column 0)
at runLoaders (C:\Users\quang\Documents\PROJECT\DEMO\PROJECT-NAME\node_modules\webpack\lib\NormalModule.js:316:20)
at C:\Users\quang\Documents\PROJECT\DEMO\PROJECT-NAME\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\Users\quang\Documents\PROJECT\DEMO\PROJECT-NAME\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\Users\quang\Documents\PROJECT\DEMO\PROJECT-NAME\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at Object.lessLoader (C:\Users\quang\Documents\PROJECT\DEMO\PROJECT-NAME\node_modules\less-loader\dist\index.js:57:5)

Environment Info
ng-zorro-antd 11.0.2
Browser Chrome
@LingerInside
Copy link

update your package.json

"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.0"
}

@ETXIN
Copy link

ETXIN commented Jan 21, 2021

npm i -D @angular-devkit/[email protected]

Need "less" for version 3.x
ant-design/ant-design#23125 (comment)

@quangquy87
Copy link
Author

update your package.json

"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.0"
}

I still get the same error
screenshot_1611219462

@keyant
Copy link

keyant commented Jan 21, 2021

要把 less 降级到 3.x : npm i -D less@3

vthinkxie pushed a commit to vthinkxie/ng-zorro-antd that referenced this issue Jan 22, 2021
@mrbusche
Copy link

mrbusche commented Feb 1, 2021

Looks like this is an issue again in Angular 11.1.1. Downgrading to 11.1.0 for Angular and using ng-zorro-antd 11.1.0 is successful.

@qpxtWhite
Copy link

Looks like this is an issue again in Angular 11.1.1. Downgrading to 11.1.0 for Angular and using ng-zorro-antd 11.1.0 is successful.

image
still error with [email protected] and [email protected]

@vthinkxie
Copy link
Member

vthinkxie commented Feb 7, 2021

Hi, everyone
if you still meet this issue, plz try the following steps

  1. if you have a custom theme.less file, plz try update it following https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/scripts/site/_site/doc/theme.less
  2. if you have your less.js functions, plz note there is breakchange in less 4.0 v4.0.0 less/less.js#3573

@aescobar-icc
Copy link

Hi, everyone
if you still meet this issue, plz try the following steps

  1. if you have a custom theme.less file, plz try update it following https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/scripts/site/_site/doc/theme.less
  2. if you have your less.js functions, plz note there is breakchange in less 4.0 less/less.js#3573

for the step 1, just add the line on the top:
@import "../node_modules/ng-zorro-antd/ng-zorro-antd.less";

@mrbusche
Copy link

For me the issue was prettier had removed ( and ) it thought wasn't needed. I didn't realize this until I compared our custom theme.less with the default mentioned here.

@table-padding-vertical-md: @table-padding-vertical * 3 / 4; should be
@table-padding-vertical-md: (@table-padding-vertical * 3 / 4);

Hi, everyone
if you still meet this issue, plz try the following steps

  1. if you have a custom theme.less file, plz try update it following https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/scripts/site/_site/doc/theme.less
  2. if you have your less.js functions, plz note there is breakchange in less 4.0 less/less.js#3573

@SuperUltraBugBuster
Copy link

SuperUltraBugBuster commented May 10, 2023

this issue took 4 days to solve, insted of using '../node_modules/ng-zorro-antd/ng-zorro-antd.less' you can use '../node_modules/ng-zorro-antd/src/ng-zorro-antd.css' There are various style files inside your ng-zorro-antd module, you will have to go through src folder to find ng-zorro-antd.css file.
image

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

No branches or pull requests

9 participants