Please advise if panic is warranted ;-)

191 views
Skip to first unread message

John Conti

unread,
Aug 11, 2015, 12:09:30 AM8/11/15
to Elm Discuss
I recently submitted https://github.com/elm-lang/elm-compiler/issues/1014 when my program put a "[Error] Error: The notify function has been called synchronously!" on the console in a stream (400+ fairly rapidly).  

As a newcomer to Elm, I'd like to ask how much of a dead end is this for my program?  Is this something that will reasonably get fixed in weeks, or is this a sign I should come back later?  I would like to press on to create a tidy finished first Elm project.  But that doesn't sound like fun if it will randomly fail for those who try it.

I feel like I am being a bit fussy as Elm is simply a wonderful front end programming experience.  That said, random errors during demos will certainly be deflating :-)  Also if there is anything I should be digging into to debug it myself, teaching me to fish is more than welcome!

Thanks again for the use of such an incredible and fun language.

John

Aaron VonderHaar

unread,
Aug 11, 2015, 1:20:26 AM8/11/15
to elm-d...@googlegroups.com
Can you share how you are building/running your example?  I tried the following and did not run into the error you mentioned:

git clone https://gist.github.com/7db25f71a47275bdfbd0.git
cd 7db25f71a47275bdfbd0/
elm-package install deadfoxygrandpa/Elm-Test
elm-reactor -p 8000
open http://localhost:8000/multiplication.elm

In general, when I occasionally run into weird errors, deleting ./elm-stuff/build-artifacts (or occasionally the entire ./elm-stuff) and then rebuilding fixes things.  (In the latter case, you'll need a network connection to download the dependencies again.)  If you find something like this to be the case, please add as many details as you can to the issue report.

Maybe someone else can speak to what the "[Error] Error: The notify function has been called synchronously!" might be about?

--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pete Vilter

unread,
Aug 11, 2015, 1:21:37 AM8/11/15
to Elm Discuss
This message comes up after a runtime error of some kind — it's triggered for every event the program tries to process after the runtime error. Is there another error right before the 400+ "…called synchronously…"s? That's the one you need to fix. IMO this error message should be something more like "this program has crashed because of a runtime error and is now dead".

John Conti

unread,
Aug 11, 2015, 3:17:52 AM8/11/15
to Elm Discuss
Pete, thank you.  I was able to quickly reproduce the problem and see that the first message contained a stack trace!

[Error] TypeError: undefined is not an object (evaluating 'a.height')
sliceLeft (out.html, line 4033)
sliceLeft (out.html, line 4042)
slice (out.html, line 3982)
A3 (out.html, line 7601)
(anonymous function) (out.html, line 3061)
(anonymous function) (out.html, line 3074)
(anonymous function) (out.html, line 3075)
(anonymous function) (out.html, line 7510)
(anonymous function) (out.html, line 3127)
(anonymous function) (out.html, line 7510)
(anonymous function) (out.html, line 3139)
(anonymous function) (out.html, line 3147)
A2 (out.html, line 7595)
(anonymous function) (out.html, line 3210)
(anonymous function) (out.html, line 3225)
A2 (out.html, line 7595)
notify (out.html, line 8056)
broadcastToKids (out.html, line 7852)
notify (out.html, line 7974)
broadcastToKids (out.html, line 7852)
notify (out.html, line 8085)
broadcastToKids (out.html, line 7852)
notify (out.html, line 7875)
notify (out.html, line 7069)
(anonymous function) (out.html, line 7899)

John Conti

unread,
Aug 11, 2015, 3:30:48 AM8/11/15
to Elm Discuss
This appears to be the code causing the failure:

    unasked' = Array.append (Array.slice 0 i model.unasked) (Array.slice (i+1) -1 model.unasked)

I can see several ways this could be problematic.

John Conti

unread,
Aug 11, 2015, 10:13:58 AM8/11/15
to Elm Discuss
I played with this code a bit in the repl and was not able to reproduce the problem.  So I dug into the javascript output and quickly found a part of the Array code that was stepping off the end of the javascript arrays which implement RB (I think from a comment) trees.  It is a simple off-by-one in Array.getSlot().  I wonder if the math in there has this potential and it hasn't been discovered before?

I've updated the github case with the details: https://github.com/elm-lang/elm-compiler/issues/1014

Thanks again for the help getting started with this problem!

John

Evan Czaplicki

unread,
Aug 11, 2015, 2:00:37 PM8/11/15
to elm-d...@googlegroups.com
That error is only supposed to show up in development if I do something weird (or when someone is doing crazy stuff with Native modules and ports), so I guess it can be triggered in ways I did not expect. I think I need to update the message it gives in that case to point to core issues and say more about this. Can someone outline the cases that cause that message in an issue, with an eye towards making a PR to make things clearer?

It looks like the issue may be a duplicate of one of these:
The guy who made this module normally would fix these, but he hasn't been showing for a bit. It may be worth it to just assume we need a new person to learn that code and fix these things.

Also, if your issue is one of those, can you close the elm-compiler issue and maybe add the minimal reproduction to the relevant core issue?

--

Pete Vilter

unread,
Aug 11, 2015, 2:26:01 PM8/11/15
to elm-d...@googlegroups.com
Made this issue: https://github.com/elm-lang/core/issues/344

I have also run into one of these Array issues (I forget which) and agree that a new maintainer would be nice.

You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/8RXblDRVjas/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.

John Conti

unread,
Aug 11, 2015, 11:50:50 PM8/11/15
to Elm Discuss

Also, if your issue is one of those, can you close the elm-compiler issue and maybe add the minimal reproduction to the relevant core issue?

Closed the compiler issue.  I will create a minimal reproduction and see if I think it matches any of the three cases you mention.

Thanks,
John 

John Conti

unread,
Aug 14, 2015, 11:50:43 PM8/14/15
to Elm Discuss
On Tuesday, August 11, 2015 at 9:50:50 PM UTC-6, John Conti wrote:

Also, if your issue is one of those, can you close the elm-compiler issue and maybe add the minimal reproduction to the relevant core issue?

Closed the compiler issue.  I will create a minimal reproduction and see if I think it matches any of the three cases you mention.

I have produced a minimal reproduction of the problem and included it in a core issue: https://github.com/elm-lang/core/issues/349

Additionally I reviewed each of the 3 Array issues posted above. My thought is that none of those match this issue.

I'm away for a week, but when I return I might take a swing at fixing it.  Interesting data structure!

Thanks again,
John 

John Conti

unread,
Aug 15, 2015, 12:18:06 AM8/15/15
to Elm Discuss
An additional note.  Slicing off the end of the array was not the intention of my program.  When I corrected it, the problem has, of course, gone away.  Now when I see the ominous runtime warning, I will simply look for the stack trace.

Cheers,
John

Reply all
Reply to author
Forward
0 new messages