The dynamic inspector throw Exception and crashe when the GUI node is selected

My demo and repo is here:

The dynamic inspector throw Exception and crashe when the GUI node is selected.

After the scene explorer and inspector are loaded, when I expand the GUI in the scene explorer and click the UI node, the inspector disappears and I see an exception in the browser Console.

The exception in the Console as below:

Exception Source:

But when clicking on a node under the GUI in any Playground that contains a GUI, the inspector displays the information about the selected node without any exception.

eg: Fullscreen GUI Example: https://playground.babylonjs.com/#XCPP9Y#1

1 Like

cc @RaananW

Update: After I ran “pnpm update --latest” to update the dependency to the latest, the local run mode (“pnpm run dev”) didn’t generate any exception anymore, and worked normally.
But after packaging (“pnpm run build”), the above exception still occurs.

The problem is the way we bundle the inspector and where it is getting its dependencies from.

In debug.ts you have the following lines:

import "@babylonjs/core/Legacy/legacy"
import "@babylonjs/core/Debug/debugLayer"
import "@babylonjs/inspector"

The first line is the one that exports BABYLON core’s dependencies. You should do the same to the GUI library, i.e., it can be:

import "@babylonjs/core/Legacy/legacy"
import "@babylonjs/gui/Legacy/legacy"
import "@babylonjs/core/Debug/debugLayer"
import "@babylonjs/inspector"
1 Like

Thanks! I’ll verify as soon as I can operate a my
computer.

1 Like