I have a Forge Viewer embedded into an Angular 9 application. Everything seems to be working as expected apart from a standard Full Screen button. When clicked it throws an uncaught JavaScript error that can be seen in the browser's Dev console:
Uncaught (in promise) TypeError: fullscreen error
at u (compat.js:87)
at h.doScreenModeChange (ScreenModeDelegate.js:231)
at h.u.setMode (ScreenModeDelegate.js:83)
at T.setScreenMode (ScreenModeDelegate.js:337)
at T.nextScreenMode (ScreenModeDelegate.js:354)
at s.n.onClick (GuiViewer3D.js:737)
at HTMLDivElement.<anonymous> (Button.js:33)
I went through the code referenced in the call stack and concluded that most likely the error happens during a call to a browser Fullscreen API and interrupts the correct sequence of switching to a full screen mode. The styling to the viewer container is applied successfully but the browser Full Screen is not entered. Also, the exit handler is not attached so exiting from Full Screen does not work as well.
I haven’t seen such a problem in any of the Autodesk Forge examples so I presume that the error is triggered by something different in my application. The error clearly happens in the Viewer code as can be seen from the console log.