Upload file convert to base64

I need convert input type=“file”, to base64 in ionic 5, a have problema with FileRead reader.onload = () => resolve(reader.result); is not working, this message is send to me.

Please post enough code so that others can replicate your problem, and include actual error messages you are getting (as text, not images). If you have no error messages, please restate the problem in terms like “expecting behavior X, seeing instead behavior Y”; “is not working” is too vague to be of much use to anybody.