Lib-dom conflicts using typescript 6.0

Hi, i updated our project to typescript 6.0.2 but in combination with BabylonJS 9.1.0 i get many build errors. for example:

node_modules/@babylonjs/core/Engines/engine.d.ts:1789:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'label' must be of type 'string', but here has type 'string | undefined'.

1789     label: string | undefined;
         ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:15829:5
    15829     label: string;
              ~~~~~
    'label' was also declared here.

node_modules/@babylonjs/core/Engines/engine.d.ts:1883:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'requiredFeatures' must be of type 'GPUFeatureName[] | undefined', but here has type 'GPUFeatureName[] | undefined'.

1883     requiredFeatures?: GPUFeatureName[] /* default=[] */;
         ~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:950:5
    950     requiredFeatures?: GPUFeatureName[];
            ~~~~~~~~~~~~~~~~
    'requiredFeatures' was also declared here.

node_modules/@babylonjs/core/Engines/engine.d.ts:1913:5 - error TS2416: Property 'label' in type 'GPUDevice' is not assignable to the same property in base type 'GPUObjectBase'.
  Type 'string | undefined' is not assignable to type 'string'.
    Type 'undefined' is not assignable to type 'string'.

1913     label: string | undefined;
         ~~~~~

node_modules/@babylonjs/core/Engines/engine.d.ts:1953:5 - error TS2416: Property 'label' in type 'GPUBuffer' is not assignable to the same property in base type 'GPUObjectBase'.
  Type 'string | undefined' is not assignable to type 'string'.
    Type 'undefined' is not assignable to type 'string'.

1953     label: string | undefined;
         ~~~~~

node_modules/@babylonjs/core/Engines/engine.d.ts:1980:5 - error TS2416: Property 'label' in type 'GPUTexture' is not assignable to the same property in base type 'GPUObjectBase'.
  Type 'string | undefined' is not assignable to type 'string'.
    Type 'undefined' is not assignable to type 'string'.

1980     label: string | undefined;
         ~~~~~

Currently i’m forced to use "skipLibCheck": true but i would preffer not to use this option because it hides errors in our own libraries.

Let me add @RaananW who can have a look when he ll be back on Monday

checking what happened there! we are not running on typescript 6.0.2 as well, so it should actually not happen. Checking!

I just saw you fixed the WebGPU errors. :+1:
But there are still 2 errors left:

TypeScript v6.0.3... node_modules/@babylonjs/core/Engines/engine.d.ts:2015:5 - error TS2386: Overload signatures must all be optional or required.

2015     toBase64?(options?: { alphabet?: "base64" | "base64url" | undefined; omitPadding?: boolean | undefined }): string;
         ~~~~~~~~

node_modules/@babylonjs/core/Engines/engine.d.ts:2033:5 - error TS2386: Overload signatures must all be optional or required.

2033     fromBase64?(
         ~~~~~~~~~~


Found 2 errors in the same file, starting at: node_modules/@babylonjs/core/Engines/engine.d.ts:2015

BabylonJS declares toBase64 and fromBase64 as optional but they are not optional in the official declaration: TypeScript/src/lib/esnext.typedarrays.d.ts at main · microsoft/TypeScript · GitHub

I get this error because i use "lib": [ "ESNext", "DOM" ] in the compiler options.

well, let’s fix that as well! i didn’t catch this one, sorry :slight_smile: