Closed athanclark closed 8 years ago
My mistake, this error should be moved to elm-compiler
><
So apparently v
(the argument to toString
) is actually null
in this case - that's why it passes the type === 'object'
test first, but fails on property lookup. Why might the argument be null? hmm...
So I found the offending line: https://github.com/athanclark/cooperate-frontend/blob/cd6cc501c97ddda4445b4d054760f0c5f88963fa/dist/App.js#L13284
So from my browser's stack trace, A2
(apply 2 param) is working fine, and so is log()
: https://github.com/athanclark/cooperate-frontend/blob/cd6cc501c97ddda4445b4d054760f0c5f88963fa/dist/App.js#L4833. This is so confusing, because it's obvious that the second parameter to log()
, and thus toString
is an object literal. :S
Well, the second parameter to log()
there is an object literal, right, but then the toString
implementation will recursively walk into the components of that object and try to print those. Among other things, it will thus try to print the result of this call: A2($Effects.map,ModalsAction,eff)
. You could try to reduce your case to find out whether that is actually the problematic thing.
Or, actually, it seems that the other component, the model, contains some Html
deep inside (at least at one place, in the PersonModel
type). And, well, toString
doesn't work on Html
values. See https://github.com/elm-lang/core/issues/488.
This was my exact issue - calling toString (x :: Html)
, sorry about this.
This whole project build carries the bug for me (sorry in advance for not shrinking the problem set to something clearly reproducible): https://github.com/athanclark/cooperate-frontend/tree/cd6cc501c97ddda4445b4d054760f0c5f88963fa
This is the line I'm getting the error: https://github.com/athanclark/cooperate-frontend/blob/cd6cc501c97ddda4445b4d054760f0c5f88963fa/dist/App.js#L1289
The interesting thing is that the bug only arises when I use
Debug.log
- specifically on this line: https://github.com/athanclark/cooperate-frontend/blob/cd6cc501c97ddda4445b4d054760f0c5f88963fa/src/Root.elm#L76 - if you remove this log, thein
error goes away (but still leaves me with a UX bug, for some reason my effects aren't causing actions for this modal).This was all on version 0.16.0