Cannot read property 'viewportId' of undefined