# Unable to open the inspector

**URL:** <https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208>\
**Category:** Bugs\
**Created:** [February 6, 2019, 3:03pm UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208 "2019-02-06T15:03:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spy-Seth](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/spy-seth/32/573_2.png) [@Spy-Seth](https://forum.babylonjs.com/u/Spy-Seth)\
**Post date:** [February 6, 2019, 3:03pm UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/1 "2019-02-06T15:03:00Z")

</div>

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):

```auto
﻿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 undefined
    at DebugLayer._createInspector (debugLayer.js:69)
    at debugLayer.js:134
    at HTMLScriptElement.script.onload (tools.js:959)

```

I was convinced that it came from a problem of compatibility between the inspector and the core (see [https://github.com/BabylonJS/Babylon.js/pull/5847](https://github.com/BabylonJS/Babylon.js/pull/5847)) but the problem persist.

After some digging, I discover that the inspector is still requiring the old packages names `babylonjs-gui`, `babylonjs`, `babylonjs-serializers`, `babylonjs-loaders` but not the new one published in the `@babylonjs/*` namespace that I use now

If I add again these old packages in my `package.json` and force their import in my bundle in addition of the namespaced one, the inspector work again:

```auto
import {Engine, Scene, Observer} from '@babylonjs/core'
// ...
import 'babylonjs'
import 'babylonjs-gui'
import 'babylonjs-loaders'
import 'babylonjs-serializers'

```

I that a normal behaviour or should we use the new package names in the inspector?

---

<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 6, 2019, 3:14pm UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/2 "2019-02-06T15:14:44Z")

</div>

So if you use the es6 version of babylon, you need to rely on the es6 version of the inspector.

you can import it for side effect only like here:

import("@babylonjs/inspector");

then you ll be able to rely on the inspector as usual.

I will add it to the doc.

---

<div class="post-metadata">

**Author:** ![Spy-Seth](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/spy-seth/32/573_2.png) [@Spy-Seth](https://forum.babylonjs.com/u/Spy-Seth)\
**Post date:** [February 6, 2019, 3:23pm UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/3 "2019-02-06T15:23:21Z")

</div>

Ok I just add the `import '@babylonjs/inspector'` and it works again:

```auto
import '@babylonjs/inspector'
import {Engine, Scene, Observer} from '@babylonjs/core'

```

This is a change from before where I did not have to import the inspector

A doc upgrade cool be nice on these new package 🙂 Thanks for your helps 👍

---

<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 6, 2019, 3:23pm UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/4 "2019-02-06T15:23:59Z")

</div>

No problem My fault for not documenting it 🙂

---

<div class="post-metadata">

**Author:** ![Seanmclem](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/seanmclem/32/4221_2.png) [@Seanmclem](https://forum.babylonjs.com/u/Seanmclem)\
**Post date:** [August 28, 2019, 12:24am UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/5 "2019-08-28T00:24:03Z")

</div>

I get  
“Failed to resolve module specifier “@babylonjs/inspector”. Relative references must start with either …”  
when following these instructions.

---

<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:** [August 28, 2019, 1:08am UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/6 "2019-08-28T01:08:24Z")

</div>

@Seanmclem Would be great to have more information on your setup cause it should not be a relative reference for @babylonjs/inspector.

Did you well installed both @babylonjs/core and @babylonjs/inspector ?

---

<div class="post-metadata">

**Author:** ![Seanmclem](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/seanmclem/32/4221_2.png) [@Seanmclem](https://forum.babylonjs.com/u/Seanmclem)\
**Post date:** [August 29, 2019, 1:52pm UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/7 "2019-08-29T13:52:42Z")

</div>

No I didn’t make any additional step to install it. Before in the ES5 version you just had to use it. I can do an install for it and see if that works. Is there a link to the updated Docs? Everything I have seems to be for the es5 version

---

<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:** [August 29, 2019, 2:11pm UTC](https://forum.babylonjs.com/t/unable-to-open-the-inspector/1208/8 "2019-08-29T14:11:42Z")

</div>

the doc is part of the es6 one: [ES6 - Babylon.js Documentation](https://doc.babylonjs.com/features/es6_support#almighty-inspector)

The main difference than es5 is that you want to be in control of your bundle so you need to manage all the dependencies. If you are more comfortable with the es5 umd way, you can definitely use the babylonjs package and you won t need extra tooling like before.
