Save and Load Scene

Hey I am trying to make a 3d-editor and I am facing trouble saving the scene and loading it can someone please help

export function saveSceneToLocalStorage() {
const json = scene.toJSON();
const output = JSON.stringify(json);
localStorage.setItem(“savedScene”, output);
console.log(“Scene saved to local storage.”);
}
this is how I am saving it

What’s happening though - what’s the error?

I change my approach now and I am saving it using gltfexporter and it works fine loading and saving works but I can’t select the objects after they are loaded like in the threejs editor