Build of NodeMaterial failed:
input transform from block WorldPos[TransformBlock] is not connected and is not optional.
input rgba from block FragmentOutput[FragmentOutputBlock] is not connected and is not optional.
Hi,
I was feeling a bit hopeless, but this topic gave me an idea, and it seems I’ve identified the issue. It looks like it was a problem only on es6 (this is why in pg all good) and it appears that just importing
import { NodeMaterial } from "@babylonjs/core/Materials/Node/nodeMaterial";
is not enough. I also need to include
import "@babylonjs/core/Materials/Node/Blocks";
Otherwise, the error persists. I’m not sure whom to ping or contact to resolve the import issue at the package level, or at least to add this to the documentation, perhaps on the ES6 page. @RaananW , @carolhmj
Thanks
That’s not an issue with the package, this is by design, to provide tree shaking, while still maintain package structure and the engine’s architecture.
It is required to either load the blocks you are using, or all of the blocks if you are unsure. This way the final package size is the smallest possible.
So what you are doing is right! You could also solve it by importing the NodeMaterial class this way:
import { NodeMaterial } from "@babylonjs/core/Materials/Node";