Trunk-based WASM: reload blocks after recompilation

I have an egui app which can be compiled to WASM and deployed with Trunk.

trunk serve compiles the app, serves it on localhost and recompiles it if it notices changes in the source tree.

However, whenever the app is recompiled, any browser running the app tries to reload it, and then hangs, displaying the spinning reload wheel forever.

The only way I have found of unblocking this, is to erase the site's data in the browser.

This not only happens when serving locally, but also when publishing the app to something like GitHub Pages.

What might be causing this blocking, and how might I get around it?

It looks like this problem only ever occurs if persistence of the app state is enabled.

So I guess that the blocking is caused by some incompatibility between the schema of the persisted state and that of the new version of the app. I surmise that this causes a panic when the state is deserialized, and (as I'm no web developer) I fail to spot this panic being reported somewhere in the browser.