Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript uncaught error when clicking 'Full screen' button in Forge Viewer

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.

like image 725
Alex T Avatar asked Apr 25 '26 13:04

Alex T


1 Answers

Normally This error came when a developer tries to do full screen after loading without any user action. The user must click anything on the web page before the full-screen script run.

like image 186
Rehan Rajpoot Avatar answered Apr 27 '26 11:04

Rehan Rajpoot