Throw error where 'as' not defined