Typescript error only in build not in dev

During development DefaultRenderingPipeline.cameraFov is available:

Whilst packaging a build, it gets reported the error:

Apparently there is a discrepancy between definitions used for dev and for build?

This is my setup:

Any help appreciated, thank you.

Adding @RaananW


If I remember correctly, cameraFov was never a part of the default rendering pipeline. I am not sure why it doesn’t fail during dev, but I can only assume you use js or any’s during development? Also, there might be an issue with the packages you are using. You are loading both “babylonjs” and “@babylonjs/core”, which will conflict. You should use one or the other (i would recommend @babylonjs/core). Make sure you don’t import anything from “babylonjs”, and remove it from your project.

1 Like

The abc in your image means it is a code token used somewhere else in the editor presented for convenience :slight_smile:

Property would be looking like this:

This usually happens only on types considered any in ts or when typings are not enabled

The build is checking types with tsc, probably with noEmit in your tsconfig, while your dev script is just using vite which doesnt do type checks. Js objects are of course mutable so you wont get a runtime error when slapping random unused props on an object, its just likely not used and u can probably safely remove it. Types can be wrong though, especially in manually typed libs like babylon that also has effectful code. F12 is your best friend to double check.

You can also check the code or the tsdocs to be sure. No cameraFov prop :wink: .Babylon.js/defaultRenderingPipeline.ts at master · BabylonJS/Babylon.js · GitHub

. DefaultRenderingPipeline | Babylon.js Documentation

Also just as sebavan said , vscode will show you random words that appear in the document as properties, that arent actually properties. You can turn it off in your vscode settings, its under editor: word based suggestions. The “abc” to the left of the property in your screenshot is one way to tell its just a word search match. I think there is usually some filled style icon picture when its a real prop

1 Like

Thank you for your help gentlemen.
Everything works smoothly and I can now build on Cloudfare pages automatically (too bad they have a wrong mime type for .dds files).