Cannot destructure property 'data' of '(intermediate value)' as it is undefined.