forge.js:40047 Uncaught TypeError: Cannot read property 'uid' of undefined
at FORGE.History._addState (forge.js:40047)
at FORGE.History._sceneLoadStartHandler (forge.js:40003)
at FORGE.Listener._execute (forge.js:2998)
at FORGE.Listener.execute (forge.js:3030)
at FORGE.EventDispatcher.dispatch (forge.js:2765)
at FORGE.Story._sceneLoadStartHandler (forge.js:3557)
at FORGE.Listener._execute (forge.js:2998)
at FORGE.Listener.execute (forge.js:3030)
at FORGE.EventDispatcher.dispatch (forge.js:2765)
at FORGE.Scene.loadStart (forge.js:5319)
Can be fixed by checking if currentState.scene is defined before trying to read from it:
else if (!currentState.scene || currentState.scene.uid !== newState.scene.uid)
When trying to initialize a
FORGE.Viewer
after messing with window.history, it fails at this line:https://github.com/gopro/forgejs/blob/b3b33cd71beaba5db57370a8b5ebb87e2d69bb6d/src/system/History.js#L144
and throws the following error:
Can be fixed by checking if
currentState.scene
is defined before trying to read from it: