This code might throw an error if the component doesn't any views (this is possible for components that only have resources).