In his Elm Europe 2018 talk Richard Feldman discusses using a union type for your Model. I really liked this idea, it helps to avoid polluting my main application state with state that is just used during initialization and then never again.
However when using this programming style, I find the time-travelling debugger that ships with elm-reactor crashes whenever you try to time-travel (with Uncaught TypeError: Cannot read property 'childNodes' of undefined). I have confirmed this with a tiny toy problem, so it’s not something specific to my code.
Is this a known issue, or should I file a bug (if so where is the best place)?
Does anybody know of a workaround? I suppose I could do something like:
type alias Model =
{ state : State }
type State
= Initializing Config
| MainProgram MainState
After finding that it crashed the Ellie app before I could even enter my code, I realised the problem was elsewhere.
It seems the Dark Reader chrome extension I use does not play nicely with the javascript used by Ellie and elm-reactor and causes it to crash. This took me a while to work out as it seems to sometimes even happen when Dark Reader is instructed to leave that particular page alone. I have filed a bug with Dark Reader (https://github.com/darkreader/darkreader/issues/623).
Maybe I should delete this post (although I’m not sure I know how to), now that it appears to be nothing to do with Elm? Or should I leave it in case anyone else ever finds the same problem?