TypeError: Cannot read property 'ctor' of undefined at Function.func (http://localhost:3000/js/Main.js:11594:16) at A3 (http://localhost:3000/js/Main.js:98:11) at Function.func (http://localhost:3000/js/Main.js:11781:16) at A2 (http://localhost:3000/js/Main.js:92:11) at Object.callback (http://localhost:3000/js/Main.js:1817:18) at step (http://localhost:3000/js/Main.js:2410:39) at work (http://localhost:3000/js/Main.js:2466:14)
The error is thrown in the default
case in Javascript for the main case msg of
bit of an update
function (although the update function doesn't have an otherwise
or _
)
var _user$project$Page_ExercisePage$update = F3(
function (context, msg, model) {
update:
while (true) {
var _p6 = msg;
switch (_p6.ctor) {
// (lots of cases here)
default:
if (_p6._0.ctor === 'Dispatch') { // at this point the error occurs because _p6 is actually the number 1463060035425, not an object with a `ctor` or anything
This is happening in a component which has a Timer as a subcomponent. The subscriptions are being composed with:
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.batch
[ ...
, Timer.subscriptions model.timerModel |> Sub.map TimerMsg
]
and in the Timer there is:
subscriptions : Model -> Sub Msg
subscriptions model =
Time.every 250 TimerTick
I think this is the only place that a number like 1463060035425 could be coming from. Note that the number isn't always exactly the same, although it is similar. The last three errors I logged had _p6 equal to:
- 1463060035425
- 1462955273589
- 1462961265291