Ng-zorro-antd: Error building with Angular 12

Created on 13 May 2021  ·  5Comments  ·  Source: NG-ZORRO/ng-zorro-antd

Reproduction link

https://github.com/NG-ZORRO/ng-zorro-antd

Steps to reproduce

  1. create new project
  2. add ng-zorro-antd
  3. build project

What is expected?

Successful compilation

What is actually happening?

Broken build

| Environment | Info |
|---|---|
| ng-zorro-antd | 11.4.1 |
| Browser | Chrome |


Following error occurs

```
Error: node_modules/resize-observer-polyfill/src/index.d.ts:19:18 - error TS2717: Subsequent property declarations must have the same type. Property 'contentRect' must be of type 'DOMRectReadOnly', but here has type 'DOMRectReadOnly'.

19 readonly contentRect: DOMRectReadOnly;
~~~

node_modules/typescript/lib/lib.dom.d.ts:12696:14
12696 readonly contentRect: DOMRectReadOnly;
~~~
'contentRect' was also declared here.
```

Most helpful comment

Can have a try to add "skipLibCheck" in tsconfig.json ?

https://www.typescriptlang.org/tsconfig#skipLibCheck

All 5 comments

Having the same issue - I believe it's related to the updated TypeScript when you upgrade Angular - but it is ng-zorro that is dependant upon the broken resize-observer-polyfill nonetheless

Can have a try to add "skipLibCheck" in tsconfig.json ?

https://www.typescriptlang.org/tsconfig#skipLibCheck

@vthinkxie this works, thank you - but of course isn't a long term solution

Would be nice if you guys could switch to another resize-observer-polyfill that's maintained.

mark

Was this page helpful?
0 / 5 - 0 ratings