# Editorv4.0 use API : scene.debugLayer.show() ,get error

**URL:** <https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613>\
**Category:** Questions\
**Created:** [February 23, 2021, 3:33am UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613 "2021-02-23T03:33:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HouLingLXH](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/houlinglxh/32/14545_2.png) [@HouLingLXH](https://forum.babylonjs.com/u/HouLingLXH)\
**Post date:** [February 23, 2021, 3:33am UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/1 "2021-02-23T03:33:25Z")

</div>

when i use the api: scene.debugLayer.show(),i get the error:

babylon.inspector.bundle.js:1 Uncaught TypeError: Cannot read property ‘GUI’ of undefined  
at babylon.inspector.bundle.js:1  
at babylon.inspector.bundle.js:1  
(anonymous) @ babylon.inspector.bundle.js:1  
(anonymous) @ babylon.inspector.bundle.js:1  
debugLayer.js:97 Uncaught TypeError: Cannot read property ‘Inspector’ of undefined  
at DebugLayer…/node\_modules/@babylonjs/core/Debug/debugLayer.js.DebugLayer.\_createInspector (debugLayer.js:97)  
at debugLayer.js:164  
at HTMLScriptElement.script.onload (tools.js:367)

Who can help me?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 23, 2021, 7:55am UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/2 "2021-02-23T07:55:18Z")

</div>

Welcome aboard!

This may help you:

> [@Unable to open the inspector](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208):
>
> Hey, Since some alpha release I’m not able to open the inspector by calling scene.debugLayer.show(). I get an error (the error is not always the same depending of the BabylonS version, this one is from the alpha.25): ﻿Uncaught TypeError: Cannot read property 'GUI' of undefined at babylon.inspector.bundle.js:1 at babylon.inspector.bundle.js:1 (anonymous) @ babylon.inspector.bundle.js:1 (anonymous) @ babylon.inspector.bundle.js:1 Uncaught TypeError: Cannot read property 'Inspector' of u…

---

<div class="post-metadata">

**Author:** ![HouLingLXH](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/houlinglxh/32/14545_2.png) [@HouLingLXH](https://forum.babylonjs.com/u/HouLingLXH)\
**Post date:** [February 24, 2021, 1:55am UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/3 "2021-02-24T01:55:26Z")

</div>

Thanks for your help.

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/8/82b94b3f5a9aa9c3bb2b7ae638eeece741744113.png)  
But ,when I click the axis button on inspector, I get the error :

utilityLayerRenderer.js:48 Uncaught TypeError: Cannot read property ‘getEngine’ of null  
at new UtilityLayerRenderer (utilityLayerRenderer.js:48)  
at Function.get (utilityLayerRenderer.js:212)  
at new GizmoManager (gizmoManager.js:25)  
at SceneTreeItemComponent…/components/sceneExplorer/entities/sceneTreeItemComponent.tsx.SceneTreeItemComponent.setGizmoMode (babylon.inspector.bundle.max.js:58661)  
at onClick (babylon.inspector.bundle.max.js:58831)  
at HTMLUnknownElement.callCallback (babylon.inspector.bundle.max.js:14175)  
at Object.invokeGuardedCallbackDev (babylon.inspector.bundle.max.js:14224)  
at invokeGuardedCallback (babylon.inspector.bundle.max.js:14279)  
at invokeGuardedCallbackAndCatchFirstError (babylon.inspector.bundle.max.js:14293)  
at executeDispatch (babylon.inspector.bundle.max.js:14376)

Can you help me? Thanks.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 24, 2021, 9:53am UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/4 "2021-02-24T09:53:42Z")

</div>

It’s going to be hard to help without a repro as this is working in the Playground.

---

<div class="post-metadata">

**Author:** ![julien-moreau](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/julien-moreau/32/12070_2.png) [@julien-moreau](https://forum.babylonjs.com/u/julien-moreau)\
**Post date:** [February 26, 2021, 11:09am UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/5 "2021-02-26T11:09:33Z")

</div>

Hey @Evgeni_Popov  
I know that this issue appears when using ES6 modules of BabylonJS. Is there a way to help you reproduce using ES6 modules? Unfortunately seems impossible with the playground

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 26, 2021, 11:16am UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/6 "2021-02-26T11:16:13Z")

</div>

I have no idea, I’m basically a noob when it comes to packages, es6 and all those things…

Maybe @sebavan will know better?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [February 26, 2021, 3:24pm UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/7 "2021-02-26T15:24:17Z")

</div>

@RaananW might also have an idea ? but a minimal repro on github would be great 🙂

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [February 26, 2021, 3:57pm UTC](https://forum.babylonjs.com/t/editorv4-0-use-api-scene-debuglayer-show-get-error/18613/8 "2021-02-26T15:57:09Z")

</div>

It feels like the umd version of the inspector is being loaded, instead of the es6. But i can’t be sure without seeing a repro.

Seeing this: `Cannot read property ‘GUI’ of undefined` make little to no sense in ES6, as the GUI namespace should not be assigned to the BABYLON namespace (which is probably what’s undefined here?)
