resize-observer-polyfill: Error when compiling: Property 'contentRect' must be of type 'DOMRectReadOnly'
Compiling TypeScript sources through NGC
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;
~~~~~~~~~~~
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 67
- Comments: 18
Commits related to this issue
- bump dependencies to latest - fix npm vulnerabilities #62 - change ResizeObserver polyfill dependency que-etc/resize-observer-polyfill#80 - bump typescript to 4.2.x and add tslib for importing helper... — committed to undergroundwires/privacy.sexy by undergroundwires 3 years ago
- build: enable `skipLibCheck` TS config option This allows ignoring the error that is thrown due to the incompatibility of the typings in `resize-observer-polyfill` version <=1.5.1 with TypeScript ver... — committed to angular/ngcc-validation by gkalpak 3 years ago
- build: enable `skipLibCheck` TS config option This allows ignoring the error that is thrown due to the incompatibility of the typings in `resize-observer-polyfill` version <=1.5.1 with TypeScript ver... — committed to angular/ngcc-validation by gkalpak 3 years ago
- build: enable `skipLibCheck` TS config option This allows ignoring the error that is thrown due to the incompatibility of the typings in `resize-observer-polyfill` version <=1.5.1 with TypeScript ver... — committed to angular/ngcc-validation by gkalpak 3 years ago
- Replace resize-observer-polyfill with @juggle/resize-observer to fix typescript errors (https://github.com/que-etc/resize-observer-polyfill/issues/80) — committed to Workgrid/workgrid-javascript by TuckerWhitehouse 3 years ago
- build: enable `skipLibCheck` TS config option This allows ignoring the error that is thrown due to the incompatibility of the typings in `resize-observer-polyfill` version <=1.5.1 with TypeScript ver... — committed to angular/ngcc-validation by gkalpak 3 years ago
- build: enable `skipLibCheck` TS config option This allows ignoring the error that is thrown due to the incompatibility of the typings in `resize-observer-polyfill` version <=1.5.1 with TypeScript ver... — committed to angular/ngcc-validation by gkalpak 3 years ago
- build: enable `skipLibCheck` TS config option This allows ignoring the error that is thrown due to the incompatibility of the typings in `resize-observer-polyfill` version <=1.5.1 with TypeScript ver... — committed to angular/ngcc-validation by gkalpak 3 years ago
- Update index.d.ts to avoid erros with new TS This unique line solves the following error when updating for newer TS versions: Error: node_modules/resize-observer-polyfill/src/index.d.ts:19:18 - e... — committed to jonastieppo/resize-observer-polyfill by jonastieppo a year ago
- bump dependencies to latest - fix npm vulnerabilities #62 - change ResizeObserver polyfill dependency que-etc/resize-observer-polyfill#80 - bump typescript to 4.2.x and add tslib for importing helper... — committed to LarrMarburger/privacy.sexy by undergroundwires 3 years ago
Guys there is fix for this “skipLibCheck”: true," in your tsconfig.json and recompile the applicaiton
When this fix will be merged into master?
By using this method i can run my application now.
You can try adding “skipLibCheck” option in
tsconfig.json
if the underlying libraries are using ithttps://www.typescriptlang.org/tsconfig#skipLibCheck
I guess a resolution for this issue is to change the resize observer. We switched it with @juggle/resize-observer with small additional changes and this resolved the issue.
The issue is because the latest version of TypeScript ships with an official type definition, which this library conflicts with.
We’ve quick-fixed it by just using:
But that obviously only works if you have a direct dependency on it.
I guess you’d have to reach out to whichever library is using it, and ask them to do something about it?
We don’t have
@types/resize-observer-browser
installed, but also get this issue.@HristoP96 thank you too ! Just had the problem after switching to angular 12 using typescript 4.2.4. I’ll give a try to @juggle/resize-observer
bonsoir l équipe j ai eu le même problème que faire
Angular 12 supports and actually requires typescript 4.2. As option you can just remove resize-observer-polyfill module at all. You can use ResizeObserver definition exactly from typescript package.
@BenLune any luck? have the same issue when upgrading to Angular 12.
Is there any ETA on this getting officially fixed?
I think this happens when “@types/resize-observer-browser” is also installed.