# Safari (Mac) Bug: GLB Fails to Load After Create Screenshot Using Render Target

**URL:** <https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381>\
**Category:** Bugs\
**Created:** [February 4, 2025, 1:44pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381 "2025-02-04T13:44:39Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 4, 2025, 1:44pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/1 "2025-02-04T13:44:40Z")

</div>

Hello dear community,

I hope you can help me somehow. After hours of searching and reading through forums, I couldn’t find a solution to my problem. The issue occurs exclusively on Mac with the Safari browser:

When I render a screenshot using `CreateScreenshotUsingRenderTarget` and then try to load a GLB into the scene, the GLB does not load. The console shows the following error log:

`BJS - [14:19:58]: Unable to load from https://www.babylonjs.com/Assets/DamagedHelmet/glTF/DamagedHelmet.gltf: undefined is not an object (evaluating 'h._features.forceBitmapOverHTMLImageElement')`

How can I solve this problem? I definitely want to render the scene using `CreateScreenshotUsingRenderTarget`.

Here is the playground for testing: When a screenshot is taken, the helmet is not loaded into the scene.

> **[Babylon.js Playground](https://playground.babylonjs.com/#55GIRT%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

Thank you for any suggestions!

---

<div class="post-metadata">

**Author:** ![SimoneDev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/simonedev/32/44252_2.png) [@SimoneDev](https://forum.babylonjs.com/u/SimoneDev)\
**Post date:** [February 4, 2025, 5:18pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/2 "2025-02-04T17:18:32Z")

</div>

I can’t reproduce it. Here the steps:

1. Open [https://playground.babylonjs.com/#55GIRT#1](https://playground.babylonjs.com/#55GIRT#1) in Safari browser
2. “BoomBox” (.glb) stereo is imported and injected into the scene
3. Click on “Take Screenshot” button (the screenshot is downloaded)
4. Click on “Load Helmet” button, the “DamagedHelmet” (.gltf) helmet is imported and injected into the scene

 ![Screenshot 2025-02-04 alle 18.09.47](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/f/cf6c211464c0e310d7892f88b1166ee36cf504f3.jpeg)

Note: the JavaScript errors are not related (they refer to missing source maps of Monaco editor).

Safari version: 18.1 (20619.2.8.11.10)

---

<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 4, 2025, 5:21pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/3 "2025-02-04T17:21:32Z")

</div>

Same experience on chrome.

---

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 4, 2025, 6:12pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/4 "2025-02-04T18:12:27Z")

</div>

> [@SimoneDev](#):
>
> ote: the JavaScript errors are not related (they refer to missing source maps of Monaco editor

That’s strange, it doesn’t work for me and gives the mentioned error log, preventing any GLB from being loaded into the scene afterward.

Safari Version 18.3 (18620.2.4.111.8, 18620)

---

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 4, 2025, 6:12pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/5 "2025-02-04T18:12:54Z")

</div>

The problem occurs exclusively in Safari. Everything works fine in Chrome and Firefox.

---

<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 4, 2025, 6:14pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/6 "2025-02-04T18:14:50Z")

</div>

Sorry, I just saw that sentence in the original message.  
Any specific version of Safari? I just tested on 18.3 as well, and it works.

---

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 4, 2025, 6:19pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/7 "2025-02-04T18:19:45Z")

</div>

Thank you for testing, RaananW! No, I don’t have a special Safari version: Version 18.3 (18620.2.4.111.8, 18620  
I guess it must be a local issue on my MacBook.

---

<div class="post-metadata">

**Author:** ![SimoneDev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/simonedev/32/44252_2.png) [@SimoneDev](https://forum.babylonjs.com/u/SimoneDev)\
**Post date:** [February 4, 2025, 7:31pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/8 "2025-02-04T19:31:13Z")

</div>

Can you try to clear all cache data or test in a new private window?

1. Click on the “Safari” menu in the top left hand corner next to the Apple symbol
2. Click on “Settings…”
3. A new dialogue box will open
4. Click “Privacy”
5. Click on the “Manage Website Data” button
6. To remove any cached data and cookies from your computer, click “Remove all” (or select “[babylonjs.com](http://babylonjs.com)” entry and click on “Remove” button).

Then close and reopen Safari and repeat the test.

---

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 5, 2025, 7:57am UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/9 "2025-02-05T07:57:56Z")

</div>

Thank you very much for the tip, Simone. Unfortunately, it didn’t make any difference, the error persists. Maybe it’s due to my old OS (Ventura 13.7.3 (22H417)).  
It’s complicated. I’m working on a Photoshop UXP plugin where I want to use Babylon. On my test Mac, the mentioned error also occurs in Photoshop. I had read that Photoshop actually uses the Chromium browser. I’m at a loss.

But thank you for the tips and for testing. \<3

---

<div class="post-metadata">

**Author:** ![SimoneDev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/simonedev/32/44252_2.png) [@SimoneDev](https://forum.babylonjs.com/u/SimoneDev)\
**Post date:** [February 5, 2025, 10:11am UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/10 "2025-02-05T10:11:50Z")

</div>

I’m sorry. Anyway, if you need to test on Safari browser, you can consider alternative solutions like BrowserStack.

---

<div class="post-metadata">

**Author:** ![dgorbash](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dgorbash/32/5133_2.png) [@dgorbash](https://forum.babylonjs.com/u/dgorbash)\
**Post date:** [February 5, 2025, 9:45pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/11 "2025-02-05T21:45:46Z")

</div>

Hi @Sigko ,

I can reproduce the issue on my old Mac (macOS 12.7, Safari 17.6). At the same time on the new one (w/ Safari 18.3), everything works fine.

I’ll try to dive deeper into the issue later this week, maybe I’ll find something useful.

---

<div class="post-metadata">

**Author:** ![dgorbash](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dgorbash/32/5133_2.png) [@dgorbash](https://forum.babylonjs.com/u/dgorbash)\
**Post date:** [February 6, 2025, 12:10am UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/12 "2025-02-06T00:10:58Z")

</div>

Hi @RaananW ,

I think I found the reason why this issue is happening.  
The problem is in the [dumpTools.ts#L40-L47](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Misc/dumpTools.ts#L40-L47).  
First, it tries to create a new Engine using OffscreenCanvas and in case WebGL is not supported it falls back to normal Canvas.  
But the problem is that the previously created Engine (w/ OffscreenCanvas) remains in the EngineStore but in an uninitialized state (\_initFeatures was not called, etc.).

This results in 2 engines stored inside EngineStore: #1 - a fully functional Engine used by the main scene, and #2 - an uninitialized leftover created by DumpTools.

Later, when we try to load a new GLB model (or any other action using fileTools), we end up on [fileTools.ts#L210](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Misc/fileTools.ts#L210) which grabs “broken” engine #2 from the EngineStore and fails on line [fileTools.ts#L241](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Misc/fileTools.ts#L241) (\_features was not initialized in the constructor).

I can see two possible solutions here:  
a) remove the engine instance from the EngineStore before throwing an error ([thinEngine.ts#L391-L404](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Engines/thinEngine.ts#L391-L404))  
b) handle this situation in dumpTools.ts and remove the “broken” instance from EngineStore in line [dumpTools.ts#L44](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Misc/dumpTools.ts#L44) before creating another Engine instance.

Here is the PG that demonstrates the problem in any browser:

> **[Babylon.js Playground](https://playground.babylonjs.com/#55GIRT%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

Hope this will help.

---

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 6, 2025, 10:35am UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/13 "2025-02-06T10:35:57Z")

</div>

Hello @dgorbash,

Thanks for your effort! The fact that the problem seems to be identified definitely makes it easier to test (on the PC). However, I unfortunately don’t have any idea on how to implement any of your solutions.

---

<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 6, 2025, 1:25pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/14 "2025-02-06T13:25:21Z")

</div>

Ha! Interesting. Great catch! Let’s fix that. i’ll have to see how I can validate that.

---

<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 6, 2025, 2:30pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/15 "2025-02-06T14:30:01Z")

</div>

Want to test a fix? [https://playground.babylonjs.com/?snapshot=refs/pull/16151/merge#55GIRT#4](https://playground.babylonjs.com/?snapshot=refs/pull/16151/merge#55GIRT#4)

---

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 6, 2025, 3:13pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/16 "2025-02-06T15:13:04Z")

</div>

Awesome, @RaananW! It works for me on PC with Chrome and Firefox. I will test it later in Safari and Photoshop on my Mac.

Thank you so much, I’m really excited! 😊

---

<div class="post-metadata">

**Author:** ![Sigko](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sigko/32/44910_2.png) [@Sigko](https://forum.babylonjs.com/u/Sigko)\
**Post date:** [February 6, 2025, 6:38pm UTC](https://forum.babylonjs.com/t/safari-mac-bug-glb-fails-to-load-after-create-screenshot-using-render-target/56381/17 "2025-02-06T18:38:09Z")

</div>

It also works perfectly on the Mac with Safari. Now I’m looking forward to the 7.48.0 release. Thanks again @dgorbash, and @RaananW (hab grad gesehen, du kommst aus der Hauptstadt, ganz liebe Grüße aus Johannisthal Nachbar:)). You’re awesome!
