It looks like the line in which you are doing
const storageRef = firebase.storage(app).ref();
should instead be
const storageRef = getStorage(app);
The getStorage object is imported at the top of the script already.
I looked at this documentation to figure that out.