Error when trying to define a "type" property