# Intermittent CesiumJS Rendering Crash – WebGL2 shaderSource Error

**URL:** <https://community.cesium.com/t/intermittent-cesiumjs-rendering-crash-webgl2-shadersource-error/44273>\
**Category:** CesiumJS\
**Created:** [November 25, 2025, 5:56am UTC](https://community.cesium.com/t/intermittent-cesiumjs-rendering-crash-webgl2-shadersource-error/44273 "2025-11-25T05:56:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Efraim-Benezra\_GLOBA](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/efraim-benezra_globa/32/32233_2.png) [@Efraim-Benezra\_GLOBA](https://community.cesium.com/u/Efraim-Benezra_GLOBA)\
**Post date:** [November 25, 2025, 5:56am UTC](https://community.cesium.com/t/intermittent-cesiumjs-rendering-crash-webgl2-shadersource-error/44273/1 "2025-11-25T05:56:30Z")

</div>

Hello Cesium Support Team,

I am reaching out for assistance regarding an intermittent rendering crash in our CesiumJS-based application. We see this issue during map initialization or when loading entities, and it occurs unpredictably in production.

We consistently receive the following runtime error:

An error occurred while rendering. Rendering has stopped.

TypeError: Failed to execute ‘shaderSource’ on ‘WebGL2RenderingContext’:

parameter 1 is not of type ‘WebGLShader’.

We also see Chrome DevTools reporting that the render process unexpectedly terminates:

Debugging connection was closed. Reason: Render process gone.

**Environment Details**

- Browser: Google Chrome 114.0.5

- CesiumJS Version: (114)

- GPU: Hardware supports 3D + WebGL

- Context: WebGL2

- Environment: Production

- Features: Using Cesium Custom Shaders + multiple 3D entities

**Observed Behavior**

- The crash is random, not tied to specific user actions.

- It typically occurs during scene load (“Initializing entities”).

- When the error appears, Cesium stops rendering entirely.

- The issue seems related to shader creation or WebGL2 context loss.

**Screenshots**

Below are screenshots showing the crash, error dialogs, and DevTools output:

Screenshot 1 – Rendering crash message

Screenshot 2 – DevTools showing WebGL shaderSource error

Screenshot 3 – Full stack trace and error screen

**Questions for Support**

1. Is this a known CesiumJS issue with WebGL2 or custom shader handling?

2. Are there recommended mitigation steps (memory settings, context options, shader limits, etc.)?

3. What is the recommended approach for handling WebGL context loss in Cesium?

4. Could this be caused by custom shaders combined with 3D Tiles?

5. Are there fixes for this issue in more recent Cesium releases?

Any guidance would be greatly appreciated. The issue is affecting production stability, and we would like to understand the root cause and recommended remediation.

Thank you very much.

 ![WhatsApp Image 2025-10-22 at 17.05.11](https://global.discourse-cdn.com/cesium/original/3X/3/e/3e1dd3a3fcf528cc49845212b5174527f1b96e40.jpeg)

Best regards,

Efi Ben Ezra

[Efi.BenEzra@elbitsystems.com](mailto:Efi.BenEzra@elbitsystems.com)

---

<div class="post-metadata">

**Author:** ![jjhembd](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/jjhembd/32/10144_2.png) [@jjhembd](https://community.cesium.com/u/jjhembd)\
**Post date:** [December 10, 2025, 4:44pm UTC](https://community.cesium.com/t/intermittent-cesiumjs-rendering-crash-webgl2-shadersource-error/44273/2 "2025-12-10T16:44:00Z")

</div>

Hi @Efraim-Benezra_GLOBA, I’m only seeing the first screenshot. Can you please post the other two images? I’m especially interested in the stack trace for the `shaderSource` error.

---

<div class="post-metadata">

**Author:** ![Efi\_Ben\_Ezra](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/efi_ben_ezra/32/2709_2.png) [@Efi\_Ben\_Ezra](https://community.cesium.com/u/Efi_Ben_Ezra)\
**Post date:** [December 10, 2025, 9:12pm UTC](https://community.cesium.com/t/intermittent-cesiumjs-rendering-crash-webgl2-shadersource-error/44273/3 "2025-12-10T21:12:54Z")

</div>

Hi,

Attach is more pictures.

Thanks.

Efi.

 ![image](https://global.discourse-cdn.com/cesium/original/3X/d/9/d935498532dbe88df4ab2d580405a022d5b14ebd.jpeg)

 ![image](https://global.discourse-cdn.com/cesium/original/3X/2/2/22ad0d47e0d11afe23a588d0dfb3b83e95adaebf.jpeg)

 ![image](https://global.discourse-cdn.com/cesium/original/3X/9/a/9a705f91d04b91e1512c30f90a92820f5e5915fd.jpeg)

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [December 11, 2025, 1:42pm UTC](https://community.cesium.com/t/intermittent-cesiumjs-rendering-crash-webgl2-shadersource-error/44273/4 "2025-12-11T13:42:30Z")

</div>

Just judging from the error messages, the “normalized result is not a number” and the “Failed to execute ‘shaderSource’” errors look like they **might** be unrelated - but it’s not impossible that one of them **causes** the other.

Custom shaders have nearly no “security nets”. They are very powerful, but the user is responsible to ensure their correctness.

Beyond that, the (photos of) stack traces may not be so helpful for analyzing (and solving) the issue. Things that could be worth trying:

- If possible, running this using a non-minimized version of CesiumJS could make the stack traces clearer. (Instead of `at tR.execute`, it would then say the actual class name - for example, `at CustomShader.execute` or so).
- You could try to run the application _without_ custom shaders (just leaving the default shaders). If this is possible then it _could_ help to narrow down the reason for the error. For example, when the “normalized result is not a number” error then **still** appears, it’s clear that this is caused by the entitiy creation itself, and not by the shaders
- Ideally, if it is possible to post a **minimal** Sandcastle where the error can be obserted (maybe only creating a _single_ entity, and only a “dummy” Custom Shader), then people could more dedicatedly analyze this issue
