Page not connecting to correct JavaScript context

I have an app, with a Router. One page has a button with Clicked="{clicked}", which is

function clicked() {
    console.log("clicked");
    router.goto("clickedpage");
}

First time through this it works ok. But after the JavaScript is disposed, and created again, the button does not do anything. I suspect that it loses track of which JavaScript context that belongs to it after disposing and recreating.

Hi. There is only one global JavaScript context, so I don’t think that is the case.

Can you please provide a project that reproduces the issue ?

I have not been able to create another project, that reproduces this other than the main one I’m working on.