### What problem does this PR solve? fix: TypeError: Cannot read properties of undefined (reading 'viewport' #1761 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)