"WebSharper: Uncaught asynchronous exception Error: KeyNotFoundException"

I have a number of dependent Doc.SelectDyn elements embedded in Form.Manys. They throw the above error to the console and prevent subforms from rendering.

The selcet options are updated via reactive variables that are set in rpc calls based on results the user has made in previous sections of the form. I've run into this problem before and I though I had fixed it by a combination of: 1) registering the select in a View.Map that only embedded the element once the reactive varible had loaded 2) passing the initial value of the form field via a reactive variable that was tied to the option variable so that there could be no desync between the html options and the websharper provided value.

However on this current (more complex) form, no. 1 does not solve the problem and I don't see how number 2 could be possible as some of the determining forms are themselves siblings in a manyform.

Can anyone advise?

  • adam.granicz

    Do you have a failing example? In the meantime, there have been a couple related questions here and here that might help.

    • TPierson

      Looks like this is a version of the questions you linked. I'll have to refactor. Thanks.