rtc-diagnostics icon indicating copy to clipboard operation
rtc-diagnostics copied to clipboard

Getting DOMError while doing ng serve in angular

Open pawanjaiswal182 opened this issue 11 months ago • 7 comments

Describe the bug

Getting DOMError while doing ng serve in angular.

Error: node_modules/@twilio/rtc-diagnostics/es5/lib/errors/DiagnosticError.d.ts:10:15 - error TS2304: Cannot find name 'DOMError'.

10 domError: DOMError | DOMException | undefined; ~~~~~~~~ Error: node_modules/@twilio/rtc-diagnostics/es5/lib/errors/DiagnosticError.d.ts:27:28 - error TS2304: Cannot find name 'DOMError'.

27 constructor(domError?: DOMError | DOMException, message?: string);

× Failed to compile.

To Reproduce Install the @twilio/rtc-diagnostics and then do ng serve in angular.

Expected behavior It should build the project without any error.

Environment

  • OS: Windows 11 Pro
  • Browser: chrome Version 115.0.5790.110 (Official Build) (64-bit)
  • Node.js version: v18.16.0
  • [email protected] "@twilio/rtc-diagnostics": "^1.0.1",

pawanjaiswal182 avatar Jul 29 '23 05:07 pawanjaiswal182

Even I have noticed the same error , We need to replcae the DomError to DomException. Because the DOMError is depcrecated now.

Please remove and update the files wherever the Error type is declared as DOMError.

This is causing the build issue in our local. Please do the needful.

uk8566 avatar Jul 29 '23 06:07 uk8566

@pawanjaiswal182 @uk8566 Thanks for submitting. Are you seeing this on other frameworks outside of Angular?

charliesantos avatar Jul 31 '23 16:07 charliesantos

@charliesantos I'm having the same error in a react app. It looks like the interface DOMError was removed starting with typescript 4.4

https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1029#issuecomment-869224737

fgarciachipi avatar Oct 06 '23 19:10 fgarciachipi

@pawanjaiswal182 any resolution ?

AravindJo-kore avatar Apr 02 '24 12:04 AravindJo-kore

Hi @charliesantos ! Are there any updates on this issue? It takes an hour to fix this in lib, I just don't have permission to create a branch (( Maybe someone from your side can take care of this? Because we are blocked from update higher than Angular 12 with this issue :(

Lokis2009 avatar Apr 08 '24 12:04 Lokis2009

We can achieve this by declaring type DOMError in your angular repo

umair-optevus avatar Apr 08 '24 12:04 umair-optevus

Thanks for the ping everyone and apologies for the late response. I submitted an internal ticket to fix this but it's currently low in priority due to other higher priority items. Please use the workaround @umair-optevus provided for now. Thank you.

charliesantos avatar Apr 08 '24 16:04 charliesantos

We can achieve this by declaring type DOMError in your angular repo

created new file with src/typings/dom-error.d.ts interface DOMError extends Error { name:string; message: string; } and included in typeRoots but not luck

and i don't want to use skipLibCheck: true

AravindJo-kore avatar May 14 '24 17:05 AravindJo-kore