elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.56k stars 662 forks source link

Uncaught Error: The notify function has been called synchronously! This can lead to frames being dropped. Definitely report this #1122

Closed letronje closed 8 years ago

letronje commented 9 years ago

I am getting lots of instances of the following runtime error for a simple hello worldish elm app

Uncaught Error: The notify function has been called synchronously! This can lead to frames being dropped. Definitely report this to https://github.com/elm-lang/Elm/issues

Code: https://gist.github.com/letronje/41a79415fd280f63e2a0

I see in the js console when i type in stuff into the input value.

samdesota commented 9 years ago

+1 with the debugger

mationai commented 9 years ago

Same error running examples/1 in https://github.com/evancz/elm-architecture-tutorial/

Triggered after clicking [+], [-], and [rewind] in debug panel.

Running 0.15.1

mationai commented 9 years ago

Retried, couldn't reproduce it anymore in the elm-architecture-tutorial/examples/1

jvoigtlaender commented 9 years ago

Are you all experiencing this only in debugger/elm-reactor? If so, please move this issue over to https://github.com/elm-lang/elm-reactor. Also, first check whether there isn't already an issue open there that covers the problem you are reporting.

jvoigtlaender commented 9 years ago

Otherwise, https://github.com/elm-lang/core, but not this repo here.

luck02 commented 8 years ago

I'm getting something similiar but don't know much at all about elm (just done a few tutorials).

what would be usefull to report?

jvoigtlaender commented 8 years ago

What would be useful is to answer the question I asked to the other guys above:

Are you experiencing this only in debugger/elm-reactor?

luck02 commented 8 years ago

That's actually not entirely straightforward.

The environment i'm experiencing this in is: 1) Chrome Browser 2) Elm is compiled by a gulp task. 3) Elm-Reactor IS running but strictly as a web server as far as I'm aware. 4) I'm loading an index.html page that references the compiled elm JS file. 5) The error is occurring / showing up in the chrome tools console.

The item I'm working on is directly working on JS / ELM interop so I couldn't be solely running in the reactor as far as I'm aware, on the other hand I don't know enough about what elm-reactor does in this context (Nothing I would assume). I'm seeing this error when the page lies dormant for a period of time and then I try to interact with it (seems so).

Here is the code that creates the error:

throw new Error( 'The notify function has been called synchronously!\n' + 'This can lead to frames being dropped.\n' + 'Definitely report this to <https://github.com/elm-lang/Elm/issues>\n');

jvoigtlaender commented 8 years ago

I see. That's indeed a complicated setup. So it's difficult to say what exactly is going wrong. Maybe your best bet is to wait until the next release of Elm, which is supposed to have a fixed elm-reactor.

Also, I already know what specific code creates the error. The problem is that that code shouldn't give the report it does. It should give a more meaningful/directed notice. See https://github.com/elm-lang/core/issues/430.

luck02 commented 8 years ago

Sounds good to me, this isn't holding me up at all. I was just following the instructions in the error message :)

Any idea when the next version of ELM is due out?

jvoigtlaender commented 8 years ago

Any idea when the next version of ELM is due out?

An idea, and some hope, but no say in the matter. From what I've read, I would expect within the next two/three months.

markhamburg commented 8 years ago

I just had this happen as well. It was preceded by a console warning that:

Uncaught Error: Equality error: general function equality is undecidable, and therefore, unsupported

I don't believe I compare functions for equality but if I do and it isn't supported, I would have expected the compiler to complain about that.

As for the general circumstances: I'm running in Chrome on a Mac. I have a dropzone.js div handling a file upload and reporting uploads for individual files via a port. When we get a report, it triggers a fetch of the full list of files from the server and a re-render. This works fine for quite a while and then stops once these errors appear. The uploads, however, do continue.

jvoigtlaender commented 8 years ago

@markhamburg, about this:

I don't believe I compare functions for equality

You might be doing it accidentally/indirectly, for example, by using Signal.dropRepeats on a signal that carries records, some field of which contains a function type.

And about this:

... but if I do and it isn't supported, I would have expected the compiler to complain about that.

That's more complicated than you might assume it to be. There's been lots and repeated discussion of this already. If you want to follow up on it, start with https://github.com/elm-lang/elm-compiler/issues/1145#issuecomment-153335580 and all the places pointed to from there.

markhamburg commented 8 years ago

This does now remind me that I did add a function into one of the structures in my model... So, that may explain that error message. I am interested that it doesn't fire routinely since I do the comparisons that would trigger this fairly often.

On Fri, Apr 22, 2016 at 11:11 PM, Janis Voigtländer < notifications@github.com> wrote:

@markhamburg https://github.com/markhamburg, about this:

I don't believe I compare functions for equality

You might be doing it accidentally/indirectly, for example, by using Signal.dropRepeats on a signal that carries records, some field of which contains a function type.

And about this:

... but if I do and it isn't supported, I would have expected the compiler to complain about that.

That's more complicated than you might assume it to be. There's been lots and repeated discussion of this already. If you want to follow up on it, start with #1145 (comment) https://github.com/elm-lang/elm-compiler/issues/1145#issuecomment-153335580 and all the places pointed to from there.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/elm-lang/elm-compiler/issues/1122#issuecomment-213673071

jvoigtlaender commented 8 years ago

@markhamburg, two exemplary reasons why you may not see this error triggered as often as you expect from just knowing that you do compare models containing functions:

  1. ( identity , True ) == ( \x -> x , False ) doesn't trigger the error, even though ( identity , True ) == ( \x -> x , True ) does.
  2. identity == identity doesn't trigger the error, even though identity == \x -> x does.