"Uncaught TypeError: scene.isPhysicsEnabled is not a function" . when using SceneSerializer

I tried exporting a scene using the demo code here: Save Your Scene - Babylon.js Documentation

I’m using the current version available here:

I got this error;
sceneSerializer.ts:139 Uncaught TypeError: scene.isPhysicsEnabled is not a function
at Function…/Misc/sceneSerializer.ts.SceneSerializer.Serialize (VM1608 babylon.max.js:108315)
at :1:51

I think this could be because somewhere else in the codebase a Scene object is generated with an OLDER version of babylon which doesnt have isPhysicsEnabled. Is there a way to copy the scene into a new version of the class with that function so the exporter works?

EDIT: old version: 4.0.0 engine
new version: 4.0.3 engine

Hi and welcome!

So, I wonder how this is possible - did you load two versions of babylon as dependency? Could you check that in the playground or share with us how you initialize your scene?