Ng-zorro-antd: 无法使用 theme, 会出现 build 错误

Created on 25 Dec 2018  ·  7Comments  ·  Source: NG-ZORRO/ng-zorro-antd

Version

7.0.0-rc.2

Environment

angular 7.1.4

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-start?filp.component.ts

Steps to reproduce

按照官网的介绍, 指定一个theme.less, 当build 的时候出现 build 错误.如下:
ERROR in ./src/theme.less (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/less-loader/dist/cjs.js??ref--15-3!./src/theme.less)
Module build failed (from ./node_modules/less-loader/dist/cjs.js):

@import './responsive';
^
Can't resolve './responsive.less' in 'xxxxxxxxxx'

What is expected?

能使用主题

What is actually happening?

build 失败

Other?

Announcement

Most helpful comment

Windows 版本 node 的 path.join 方法实现与 nix 的实现不一致, 在 *nix 系统上会导致无法正确地处理路径, 反之 (nix 打包给 Windows 使用) 则不会, 请大家不要使用 7.0.0-rc.2 版本, 我们会立即发布修复版本.

目前, 请指定版本号 [email protected] 使用.

path.join method is implemented differently on Windows with *nix systems, so style files' paths could not be accessed correctly on *nix. Please do not use 7.0.0-rc.2, we would immediately release a patch version.

For now, please use `[email protected]'.

All 7 comments

经过测试,没有发现问题,./responsive.less 在目前的所有文件内均处于正常位置,请检查你本地环境

@vthinkxie 确实有这个问题,windows下build是好的,linux环境build失败

@jncz @yinjs linux下的build记录
https://travis-ci.org/NG-ZORRO/ng-zorro-antd/jobs/472035622

ng-zorro-antd的官网是使用 ng-zorro-antd的发布包进行的打包,包含了主题定制等所有的功能,如果有问题,ci会比所有人更早的发现

本次发布由 windows 机器进行打包,导致非 windows 机器上的实现有问题,我们会尽快修复

image
确实存在同样问题

Windows 版本 node 的 path.join 方法实现与 nix 的实现不一致, 在 *nix 系统上会导致无法正确地处理路径, 反之 (nix 打包给 Windows 使用) 则不会, 请大家不要使用 7.0.0-rc.2 版本, 我们会立即发布修复版本.

目前, 请指定版本号 [email protected] 使用.

path.join method is implemented differently on Windows with *nix systems, so style files' paths could not be accessed correctly on *nix. Please do not use 7.0.0-rc.2, we would immediately release a patch version.

For now, please use `[email protected]'.

我们已经发布了 7.0.0-rc.3 版本修复了这个问题, 需要更新的同学请更新到 7.0.0-rc.3. 另外, 我们还在更新 build 工具, 以方便其他使用 Windows 的用户.

We have release 7.0.0-rc.3 to fix this. We are also updating our build tools to fix this problem for others developers who use Windows.

    "@angular/animations": "~8.0.1",
    "@angular/common": "~8.0.1",
    "@angular/compiler": "~8.0.1",
    "@angular/core": "~8.0.1",
    "@angular/forms": "~8.0.1",
    "ng-zorro-antd": "^8.3.1",

mac环境下,我也遇到同样的问题

ERROR in ./src/styles.less (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/less-loader/dist/cjs.js??ref--14-3!./src/styles.less)
Module build failed (from ./node_modules/less-loader/dist/cjs.js):


  &-round {
    .btn-round(@btn-prefix-cls);
  ^
Operation on an invalid type
      in/node_modules/ng-zorro-antd/button/style/index.less (line 75, column 4)
Was this page helpful?
0 / 5 - 0 ratings