VS Code shows "Property XX does not exist on type YY" warning

Hello, community.

I try to call scene.enableFluidRenderer(), but I get this warning: "Property 'enableFluidRenderer' does not exist on type 'Scene'."

Also, I try to call fluidRenderObject.object.setNumParticles(), and also get same warning: "Property 'setNumParticles' does not exist on type 'FluidRenderingObject'. Did you mean 'numParticles'?"

I tried to add some additional imports such as
import "@babylonjs/core/Rendering/fluidRenderer/fluidRenderer" import "@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles", but it doesnt help.

At the same time my code works well. What should I do? Thank you

Welcome aboard!

cc @RaananW, I don’t really know what you have to do for the the code editor to be aware of these objects and types…

Can I ask about your project setup? I see you are using the @babylonjs/??? packages (awesome :slight_smile: ), is your package.json defines type: module, or sideEffects: false? What is the module resolution in your tsconfig?

Importing “@babylonjs/core/Rendering/fluidRenderer/fluidRenderer” should do the trick, but it seems like vscode doesn’t like it for some reason.
If you can share a reproduction project, also including your vscode version it will help a lot with debugging this issue.

I am glad your build system works as expected, vscode should also work correctly, of course :slight_smile:

1 Like

Sure, I use VueJS 3 with Vite 4 and Babylon.JS 6. Also, my vs code version is 1.78.2 (latest release).

It seems that I can’t upload any json files, so here is pastebin of package.json & tsconfig.json: // package.json{ "name": "diploma", "version": "0.0.0", "private": tr - Pastebin.com

and file with warnings: import { Scene, Engine, Vector3, Mesh, Plane, PBRM - Pastebin.com (Line 96 and 278)

Thank you

does your tsconfig contain moduleResolution definition? I noticed it happens if your moduleResolution is not node.
I’d be happy to check the actual project, if possible. will be simpler for me to debug.

My tsconfig does not contain any moduleResolution definition. I tried to add "moduleResolution": "node", but it seems it doesn’t work

Sorry, here is the link to actual project:

Thank you

1 Like

Oh my. This is 100% not on you :slight_smile:

A push is being fixed right now!
I mean - a fix is being pushed right now!

core not supported in declare module by RaananW · Pull Request #13869 · BabylonJS/Babylon.js (github.com)


wow :exploding_head:, amazing. Thank you for quick answer!

P.S. Am I right that this fix will appear in next patch release? (6.3.x)

6.4 will be released in 2 days. We might release 6.3.2 until then, but the safest would be the 6.4 release thursday morning

Okay, thank you. I will mark this as solution

1 Like