Server-side rendering exception: TypeError: Cannot read property 'type' of undefined