Thanks @Evgeni_Popov . I updated from Babylon.js 4.2.0 to latest preview 5.0.0-alpha.24, removed my webgl-strict-types dependency and now the production build works fine.
Don’t wanna necro the thread but only just came back to Babylon after few months and while updating project dependencies earlier today came across above error.
I want latest Typescript and I want BabylonJS@4.2 but so here is my work around the issue using global type declaration files.
Looking at TypeScript@v4.0.8 source code …
WebGLObject is a very simple interface, so error can be easily avoided by adding highlighted code into type definition files like globals.d.ts (or babylon.d.ts if you have one in your types folder ). Once BabylonJS@5.0 is out remove the snippet and you will be good to go.
Make sure to have typeRoots prop configured in your tsconfig.json to something like…