I am following the instructions specified here Babylon.js ES6 support with Tree Shaking | Babylon.js Documentation
After numerous failed attempts to get a babylon project working from an empty directory, I decided to relent and use their template project, linked from GitHub - RaananW/babylonjs-webpack-es6: Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. Will even make coffee if you ask nicely.
I followed the instructions to the best of my knowledge.
1: clone the repo locally
2: npm install
3: npm start
The error I am getting is:
TS2339: Property 'renderCount' does not exist on type '{ name: string; url: string; waitForNetworkIdle?: undefined; } | { name: string; url: string; waitForNetworkIdle: boolean; }'.
Property 'renderCount' does not exist on type '{ name: string; url: string; waitForNetworkIdle?: undefined; }'.
This occurs in the file validation.spec.ts
. When I look in that file, there’s:
const scenes = [
{
name: 'Default',
url: '/?scene=defaultWithTexture',
},
{
name: 'Fresnel Shader',
url: '/?scene=fresnelShader',
},
{
name: 'Load model and env',
url: '/?scene=loadModelAndEnv',
},
{
name: 'Navigation mesh recast',
url: '/?scene=navigationMeshRecast',
waitForNetworkIdle: true,
},
// {
// name: 'Physics (ammo)',
// url: '/?scene=physicsWithAmmo',
// renderCount: 5,
// },
]
then, later on, there’s a conditional if (scene.renderCount)...
so the initial array has no typing to it, when it should be something like
const scenes: { name: string, url: string, waitForNetworkIdle?: boolean, renderCount?: number }[] = { ... };
if I put that line in the code, changing nothing else, then the scene loads successfully. Alternatively, you can just not type the array at all and uncomment that last entry.