# NullEngine bug on latest preview version

**URL:** <https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898>\
**Category:** Bugs\
**Created:** [December 8, 2021, 7:36pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898 "2021-12-08T19:36:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Null](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/null/32/1947_2.png) [@Null](https://forum.babylonjs.com/u/Null)\
**Post date:** [December 8, 2021, 7:36pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/1 "2021-12-08T19:36:10Z")

</div>

Hello,

I wanted to report an issue with version **5.0.0-alpha.63**.  
I am trying to create the headless version of Babylon using NullEngine but I get the following error :

**TypeError: e.\_getDrawWrapper is not a function**

Worth noting that it worked with the latest stable version, I recently upgraded to try the WebGPU port.

Cheers.

---

<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:** [December 8, 2021, 7:42pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/2 "2021-12-08T19:42:33Z")

</div>

Adding @Evgeni_Popov who built the draw wrapper. Could you provide a repro of the code you use with nullEngine to pin point the culprit ?

---

<div class="post-metadata">

**Author:** ![Null](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/null/32/1947_2.png) [@Null](https://forum.babylonjs.com/u/Null)\
**Post date:** [December 8, 2021, 7:45pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/3 "2021-12-08T19:45:13Z")

</div>

It’s tough to provide a repro but should be fairly easy to reproduce. It always gives the error if the scene has at least one mesh and it fails on the first render call.

---

<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:** [December 9, 2021, 5:25pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/4 "2021-12-09T17:25:59Z")

</div>

I’m not able to reproduce the problem:

[https://playground.babylonjs.com/#RNJVMT](https://playground.babylonjs.com/#RNJVMT)

---

<div class="post-metadata">

**Author:** ![Null](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/null/32/1947_2.png) [@Null](https://forum.babylonjs.com/u/Null)\
**Post date:** [December 9, 2021, 11:42pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/5 "2021-12-09T23:42:31Z")

</div>

I was able to reproduce when it happens but I doubt it needs to be tested on Node.  
So basically the issue comes up when adding a render outline like this :

sphere.renderOutline = true;  
sphere.outlineWidth = 0.02;  
sphere.outlineColor = BABYLON.Color3.Black();

Obviously you don’t need an outline serverside but I am using shared components thus the issue. I wasn’t able to reproduce it in the playground as well.

---

<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:** [December 10, 2021, 4:40pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/6 "2021-12-10T16:40:26Z")

</div>

It still does not seem to break in the playground: [https://playground.babylonjs.com/#RNJVMT#1](https://playground.babylonjs.com/#RNJVMT#1) are you sure it is only this that made it break for you ?

---

<div class="post-metadata">

**Author:** ![Null](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/null/32/1947_2.png) [@Null](https://forum.babylonjs.com/u/Null)\
**Post date:** [December 12, 2021, 1:57pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/7 "2021-12-12T13:57:12Z")

</div>

Yup, I suspect it doesn’t break the playground since it still renders on a browser. Maybe if it’s tested in a NodeJS environment would be easier to replicate.

---

<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:** [December 14, 2021, 1:16am UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/8 "2021-12-14T01:16:27Z")

</div>

Would it be possible for you to create a tiny repro on Github ? This would be amazingly helpful to troubleshoot. I am not able to repro in our unit tests and the only places I am seeing **\_getDrawWrapper** in the outline do not make much senses ☹

Actually this does not fail on node:

```auto
import { NullEngine, Scene, FreeCamera, Vector3, HemisphericLight, MeshBuilder, Color3 } from '@babylonjs/core'

const engine = new NullEngine()

const scene = new Scene(engine);
new FreeCamera("camera1", new Vector3(0, 5, -10), scene);
new HemisphericLight("light", new Vector3(0, 1, 0), scene);

MeshBuilder.CreateGround("ground", {width: 6, height: 6}, scene);

const sphere = MeshBuilder.CreateSphere("sphere", {diameter: 2, segments: 32}, scene);
sphere.renderOutline = true;
sphere.outlineWidth = 0.02;
sphere.outlineColor = Color3.Black();

engine.runRenderLoop(() => {
    scene.render();
});

```

with

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/f/dfac5a08dbca5b53c6dbacdd5972a4e28cf6bd0a.png)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 12, 2022, 11:55am UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/9 "2022-01-12T11:55:03Z")

</div>

Hi @Null just checking in, were you able to create a repro? 🙂

---

<div class="post-metadata">

**Author:** ![Null](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/null/32/1947_2.png) [@Null](https://forum.babylonjs.com/u/Null)\
**Post date:** [January 12, 2022, 1:26pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/10 "2022-01-12T13:26:05Z")

</div>

Hey there, nope, I did a workaround by removing the outline in the Server side. Repro is tough given that I would need to provide the whole webpack based solution together with the wrapper I have used for Bjs.

---

<div class="post-metadata">

**Author:** ![Null](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/null/32/1947_2.png) [@Null](https://forum.babylonjs.com/u/Null)\
**Post date:** [January 12, 2022, 1:26pm UTC](https://forum.babylonjs.com/t/nullengine-bug-on-latest-preview-version/25898/11 "2022-01-12T13:26:36Z")

</div>

I’ll try this one and let you know.
