Uncaught TypeError: BABYLON.Color4.FromColor3 is not a constructor

Hy everyone !

I hope you’re all fine !!

Since the last release (tuesday afternoon, Paris hour), we can’t open a scene, we have this error message : “Uncaught TypeError: BABYLON.Color4.FromColor3 is not a constructor”

2026-07-09_17h57_21

Could you please help us ??

Thank you in advance !

Best regards

Sorry, I forgot to bring you some context…

It happen when I try to make this :

const rouge3 = new BABYLON.Color3(1, 0, 0)

const rouge4 = new BABYLON.Color4.FromColor3(rouge3, 1)

is this in the playground?

EDIT - I will need more context. what environment are you running, is that the UMD packages, playground, es6?

Hi everyone,

Yes, it is also in the playground… If you add the two lines in any playground, it fails… But it works perfectly with the 9.14.0 version.

Thanks

checking and fixing, thanks a lot

Can’t reproduce this

The error happens when you add “new” to BABYLON.Color4.FromColor3([your color]). It worked in the previous version (9.14.0) but not in the last one. May be we just have to erase the word “new” but we don’t know why this is an error in the 9.15.0 version and not in the 9.14.0 version.

I have the same error with:
color = new BABYLON.Color3.FromHexString("#fafafa");

If I remove new it works.

Console Error: Uncaught (in promise) TypeError: BABYLON.Color3.FromHexString is not a constructor

this is not a class, adding new is wrong. this was correct syntax with ES5, but we have moved to ES2015, so it is invalid syntax

@RaananW is exactly correct. There are numerous static methods in Babylon that return a newly allocated object (e.g. in the classes Vector3, Matrix, Quaternion, MeshBuilder). The static methods’ names a lot of times begin with “From” or “Create”. None of them should be preceded with “new”, for the exact reason given by @RaananW. “new” should only precede a class name when constructing an instance of that class const instance = new ClassName( constructor_parameters);. “new” shouldn’t precede a method call.