When loading the babylonjs bundle more than once, an exception is thrown out of legacy.ts:
TypeError: Cannot set property Debug of #<Object> which has only a getter
Pretty simple repo:
<!DOCTYPE html>
<html>
<body>
<script src="https://cdn.babylonjs.com/babylon.max.js"></script>
<script src="https://cdn.babylonjs.com/babylon.max.js"></script>
<p>Hello, world!</p>
</body>
</html>
This used to work. Looks like it was a change from 4.x to 5.x. If you change the script to this, it works:
<script src="https://unpkg.com/babylonjs@4.2.2/babylon.max.js"></script>
Here’s where the exception is thrown:
I get that the workaround is “simple” in this minimum repo, but in my team’s situation it is not as simple. This used to work