# shadowDepthWrapper getting error with an async adding with standalone: true

**URL:** <https://forum.babylonjs.com/t/shadowdepthwrapper-getting-error-with-an-async-adding-with-standalone-true/62769>\
**Category:** Questions\
**Created:** [March 13, 2026, 7:19am UTC](https://forum.babylonjs.com/t/shadowdepthwrapper-getting-error-with-an-async-adding-with-standalone-true/62769 "2026-03-13T07:19:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanpopo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tanpopo/32/32025_2.png) [@tanpopo](https://forum.babylonjs.com/u/tanpopo)\
**Post date:** [March 13, 2026, 7:19am UTC](https://forum.babylonjs.com/t/shadowdepthwrapper-getting-error-with-an-async-adding-with-standalone-true/62769/1 "2026-03-13T07:19:49Z")

</div>

First a small typo in shadow’s document playground named “Fixed shadows“, semicolon in line 7 should be a comma to make the playground work.

document link: [Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows)

typo playground link: [https://playground.babylonjs.com/#PNQRY1#80](https://playground.babylonjs.com/#PNQRY1#80)

Then my problem playground link: [https://playground.babylonjs.com/#PNQRY1#246](https://playground.babylonjs.com/#PNQRY1#246)

I added a shadowDepthWrapper in settimeout with `standalone: true` in line 96, and getting error. Now I had to add shadowdepthwrapper to all my materials in my situation to escape the problem, is it expected?

---

<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:** [March 13, 2026, 10:49am UTC](https://forum.babylonjs.com/t/shadowdepthwrapper-getting-error-with-an-async-adding-with-standalone-true/62769/2 "2026-03-13T10:49:21Z")

</div>



---

<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:** [March 13, 2026, 1:31pm UTC](https://forum.babylonjs.com/t/shadowdepthwrapper-getting-error-with-an-async-adding-with-standalone-true/62769/3 "2026-03-13T13:31:32Z")

</div>

Thanks for reporting and the reproduction, here’s the fix:

> <https://github.com/BabylonJS/Babylon.js/pull/18091>
>
> See https://forum.babylonjs.com/t/shadowdepthwrapper-getting-error-with-an-async…-adding-with-standalone-true/62769

---

<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:** [March 16, 2026, 10:26am UTC](https://forum.babylonjs.com/t/shadowdepthwrapper-getting-error-with-an-async-adding-with-standalone-true/62769/4 "2026-03-16T10:26:42Z")

</div>


