Unable to render widget: TypeError: Cannot read property 'slice' of null