#JS wont listen for events until hot-reloaded

5 messages · Page 1 of 1 (latest)

remote cape
#

When i initially start my app, I get the following error:
05-29 22:13:19.874 31740 31740 E Tauri/Console: File: http://tauri.localhost/ - Line 0 - Msg: Uncaught (in promise) event.listen not allowed on window main, webview main, allowed windows: , allowed webviews: , referenced by

If i then trigger a hot reload (by creating a new line and saving main.js), the js listner now listens, with no errors.

This bug only happens on js, as i have a rust listner setup, which works flawlessly each time

#

Im new to js, so ive probably done something wrong there

#

After further playing around, i realise that the js listener will only run when hot reloaded.

In any other circumstances, eg closing the app, and opening it, etc, it will simple give the error mentioned above.

thorn basalt
#

Should be fixed in the next release. (Or maybe it already is, try running cargo update in src-tauri to pull the latest wry version).

remote cape
#

Yeah, it was fixed by an update