I found the problem:
const { listen } = window.__TAURI__.event.listen;
and then using listen does not work. Instead, using
window.__TAURI__.event.listen('emit_from_rust', (event) => {
testMsgEl.innerHTML = event.payload;
});
directly in the code just does what I wanted it to do.