evancz / elm-todomvc

The TodoMVC app written in Elm, nice example for beginners.
http://evancz.github.io/elm-todomvc/
BSD 3-Clause "New" or "Revised" License
1.22k stars 329 forks source link

Fails to start with reactor #8

Closed hura closed 8 years ago

hura commented 9 years ago

The app gives me the following error if I want to run it under reactor:

Initialization Error: port 'getStorage' was not given an input!
Open the developer console for more details.
amukiza commented 9 years ago

Any luck with this issue? I am facing a similar problem.

amukiza commented 9 years ago

@hura It seems you have to initialize the storage with startingState in your html. I took a look at the index.html and I managed to run it.

passy commented 9 years ago

As far as I know ports are fundamentally incompatible with the reactor. But I'd like to know what the recommended way of dealing with that is.

4d47 commented 8 years ago

I think this issue affects more than reactor.

Using Elm Platform 0.16.0 with latest master branch. Following build instructions and opening index.html in Chrome show:

Port Error:

    No argument was given for the port named 'getStorage' with type:

        Maybe.Maybe Todo.Model

    You need to provide an initial value!

    Find out more about ports here <http://elm-lang.org/learn/Ports.elm>

Open the developer console for more details.

Elm reactor on Todo.elm give the same output but the ?debug gives:

_U.list is not a function

http://evancz.github.io/elm-todomvc/ is working but the source looks very different, I guess it's an older version of Elm and TodoMvc.

caseyhoward commented 8 years ago

I'm new to learning elm and decided I wanted to try running an example app. This is the first error I ran into. This hasn't worked since 2014? It concerns me as someone new to elm that the todo-mvc app doesn't even work. What needs to be done to fix this?

kgashok commented 8 years ago

Read this https://github.com/kgashok/elm-todomvc/blob/patch-1/README.md#troubleshooting

I could not get the elm-todomvc to work directly on the Elm web console (http://www.elm-lang.org), but I got it to work on a local build. Once you have a local build, launch index.html directly in the browser (not through the elm-reactor).

rattrayalex commented 8 years ago

I got a different error (running reactor 0.17.0):

Todo.elm:2959 Uncaught Error: You are trying to initialize module `Todo` with an unexpected argument.
When trying to convert it to a usable Elm value, I run into this problem:

I ran into the following problems:

Expecting null but instead got: undefined
Expecting an object with a field named `field` but instead got: undefined

This appeared in the JavaScript console (so much for the "no runtime errors" guarantee). It appears to work when compiled manually with --output elm.js but not without that (I get the same error).

As a first-time user, I have to say this is a big turnoff (especially given the age of this issue). This appears to be a core, canonical example application for a sparsely-documented language/framework; it should work when run without special arguments.

evancz commented 8 years ago

Since this app uses ports, it does not get "automatically" set up with the reactor. You have to follow the build instructions in the README.

kgashok commented 8 years ago

My pull request elaborates on how to troubleshoot this issue, and could be helpful for first timers.