GPUOutOfMemoryError and GPUValidationError Error with latest 5.8.0 release

Hey guys @Deltakosh and @sebavan

I am getting this error building with 5.8.0 latest release…

Using typescript 4.6.2

[04:01:54] Using gulpfile ~/Documents/Babylon/BabylonToolkit-Share/Manager/gulpfile.js
[04:01:54] Starting 'default'...
[04:01:54] Starting 'compile'...
types/babylon.d.ts(95151,15): error TS2720: Class 'GPUOutOfMemoryError' incorrectly implements class 'GPUError'. Did you mean to extend 'GPUError' and inherit its members as a subclass?
  Types have separate declarations of a private property '__brand'.
types/babylon.d.ts(95157,15): error TS2720: Class 'GPUValidationError' incorrectly implements class 'GPUError'. Did you mean to extend 'GPUError' and inherit its members as a subclass?
  Types have separate declarations of a private property '__brand'.
TypeScript: 2 semantic errors
TypeScript: emit succeeded (with errors)
[04:02:08] Finished 'compile' after 13 s
[04:02:08] Starting '<anonymous>'...
[04:02:10] Finished '<anonymous>' after 2.66 s
[04:02:10] Finished 'default' after 16 s
Mackeys-Mac-Pro:Manager mackey$ 

This should fix it:

It’s strange I didn’t have any errors in Visual Studio Code…

1 Like

FYI… i just tried to manually fix that in the types/babylon.d.ts

Changed from implements to extends

and now get this error

ackeys-Mac-Pro:Manager mackey$ gulp
[04:22:07] Using gulpfile ~/Documents/Babylon/BabylonToolkit-Share/Manager/gulpfile.js
[04:22:07] Starting 'default'...
[04:22:07] Starting 'compile'...
types/babylon.d.ts(95151,15): error TS2415: Class 'GPUOutOfMemoryError' incorrectly extends base class 'GPUError'.
  Types have separate declarations of a private property '__brand'.
types/babylon.d.ts(95157,15): error TS2415: Class 'GPUValidationError' incorrectly extends base class 'GPUError'.
  Types have separate declarations of a private property '__brand'.
TypeScript: 2 semantic errors
TypeScript: emit succeeded (with errors)
[04:22:20] Finished 'compile' after 13 s
[04:22:20] Starting '<anonymous>'...
[04:22:23] Finished '<anonymous>' after 2.56 s
[04:22:23] Finished 'default' after 16 s
Mackeys-Mac-Pro:Manager mackey$ 

this works

declare class GPUError {
    private __brand: void;
    readonly message: string;
}

declare class GPUOutOfMemoryError extends GPUError {
    //private __brand: void;
    constructor();
    readonly message: string;
}

declare class GPUValidationError extends GPUError {
    //private __brand: void;
    constructor(message: string);
    readonly message: string;
}

Yup it makes sense, @Evgeni_Popov ?

Indeed, I have fixed the PR.

1 Like