# Babylon\_lib not defined when loading inspector

**URL:** <https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766>\
**Category:** Questions\
**Created:** [July 3, 2024, 7:38am UTC](https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766 "2024-07-03T07:38:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [July 3, 2024, 7:38am UTC](https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766/1 "2024-07-03T07:38:52Z")

</div>

I get this error when calling  
`import('@babylonjs/inspector').then(() => this.babylonScene.debugLayer.show({ embedMode: true, initialTab: 2 }));`

I hadn’t used this in a long time, but it used to work fine before. (Same error when I use a normal import at the top.)  
These are my packages:

@babylonjs/core: 7.13.1  
@babylonjs/inspector: 7.13.1

I tried adding @babylonjs/loaders as well

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/c/0c16c543c7919ecf623d4b8e653e883cff0523d5.png)

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 3, 2024, 8:11am UTC](https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766/2 "2024-07-03T08:11:26Z")

</div>

From @RaananW 's babylonjs es6 starter:

```javascript
        void Promise.all([
            import("@babylonjs/core/Debug/debugLayer"),
            import("@babylonjs/inspector"),
        ]).then((_values) => {
            console.log(_values);
            scene.debugLayer.show({
                handleResize: true,
                overlay: true,
                globalRoot: document.getElementById("#root") || undefined,
            });
        });

```

> **[GitHub - RaananW/babylonjs-webpack-es6: Babylon.js basic scene with...](https://github.com/RaananW/babylonjs-webpack-es6)**
>
> Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. Will even make coffee if you ask nicely. - RaananW/babylonjs-webpack-es6

I’ve just tried it and it works.

---

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [July 3, 2024, 8:31am UTC](https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766/3 "2024-07-03T08:31:38Z")

</div>

let me clarify

this gives the exact same error: `import { Inspector } from '@babylonjs/inspector';`

even when not calling

`Inspector.Show(this.babylonScene, { handleResize: true, initialTab: 2 });`

I cannot find anything about babylon\_lib. What is it and how could it be missing?

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 3, 2024, 9:26am UTC](https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766/4 "2024-07-03T09:26:25Z")

</div>

Do you import the `debugLayer` too?

```auto
import '@babylonjs/core/Debug/debugLayer'
import '@babylonjs/inspector'

// show
await scene.debugLayer.show({ embedMode: true, overlay: true })

// hide
await this.scene.debugLayer.hide()

```

You can leave out the `await` keywords or replace with `void` if you don’t want to access the `debugLayer` programatically just right after you created it.

---

<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:** [July 3, 2024, 9:48am UTC](https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766/5 "2024-07-03T09:48:24Z")

</div>

quite odd TBH. Could you share a project reproduction? I will be happy to dig in the code.

---

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [July 3, 2024, 11:42am UTC](https://forum.babylonjs.com/t/babylon-lib-not-defined-when-loading-inspector/51766/6 "2024-07-03T11:42:45Z")

</div>

I figured it out… I had a webpack DLL cache in place that I _completely_ forgot about.  
It seems like that doesn’t work anymore with Inspector, but I can live with that.

I’m very sorry about the unwarranted post, but thanks!
