Unable to get value of the property ‘extend’: object is null or undefined