Inspector's tools: n.Color3 is not a constructor


having implemented the babylon ES6/Typescript example project
I’m geting the following error when opening the tools pane of the inspector:
“Uncaught TypeError: n.Color3 is not a constructor at VM356 babylonjs.serializers.min.js:15”.

Already double-checked this behaviour with an external repo - same result.

I’m on version 4.0.3.

Is this a known issue/bug? Or have I overlooked something?


1 Like

Hello and welcome!

Maybe @RaananW can have a look :slight_smile:

That’s odd. The serializers should be an es6 project, but you are getting the es5 bundle.

I looked in the gitlab code very quick and couldn’t find a reference to the serializers. Where can I see the code?


I uploaded the test project here.


Does it happen when you uncomment the import line?

Which import line do you mean?

I made a test and reduced imports to these 3 (that’s the minimum to implement the inspector, right?):

import { Engine, Scene } from “@babylonjs/core”;
import “@babylonjs/inspector”;
import “@babylonjs/core/Debug/debugLayer”;

Result: the error still occurs.


That’s not the serializers. that’s the inspector.

Follow this thread. It is a known issue, and we hope to fix it soon - How to use Inspector with ES6 Modules

You should be able to include the inspector as a static file to your HTML in the meantime, if that’s an acceptable method

Hm, not sure if I understand correctly. You mean I can statically embed the inspector via CDN and then use it in ES6 modules? I tried it, but it didn’t work.

In the docs it says: “Due to the modules name changing and other es6 modules differences, the UMD and CDN inspector version is not compatible with ES6. Nevertheless, you can install the ES6 version of the inspector and import it for side effect only in your code. Then the debug layer would work as usual.”

Would be great, if you could paste a snippet of how to make the CDN inspector work with ES6 modules.

And just to be clear: the problem is NOT to get the inspector running at all as an ES6 module. It’s about an error occuring when opening the tools pane using the ES6 inspector version.

I will download the repository later today or tomorrow and check.


Nice :metal:

Repo is a bit of a mess. It’s just a test setup and never meant to be public :smiley:

Use gulp develop to compile.

Two more bugs I just encountered (can be examined in the same repo):


With a mesh selected, if you open the debug panel and turn on “Display normals” in the “Debug” section, you get caught in an error and request loop.

Error: “Uncaught TypeError: Cannot read property ‘ShadersStore’ of undefined at Module…/cell/cell.fragment.ts (VM18 babylonjs.materials.js:385)”



If you turn on “Render wireframe over mesh”, the wireframe gets drawn at the world origin, not at the actual mesh position.

I cannot repro the second bug on regular PG. so maybe linked to your config/code