Skip to content

Instantly share code, notes, and snippets.

@yogsototh
Created May 28, 2015 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogsototh/43583ebe81d0658f1a16 to your computer and use it in GitHub Desktop.
Save yogsototh/43583ebe81d0658f1a16 to your computer and use it in GitHub Desktop.
elm Task or port bug?
import Http
import Markdown
import Html exposing (Html)
import Task exposing (Task, andThen)
import Time exposing (every, second)
main : Signal Html
main = Signal.map Markdown.toHtml readme.signal
-- set up mailbox
-- the signal is piped directly to main
-- the address lets us update the signal
readme : Signal.Mailbox String
readme = Signal.mailbox "# try"
-- send some markdown to our readme mailbox
report : String -> Task x ()
report markdown = Signal.send readme.address markdown
-- get the readme *and then* send the result to our mailbox
port fetchReadme : Signal (Task Http.Error ())
port fetchReadme = Signal.map (\_ -> Http.getString readmeUrl `andThen` report) (every (30 * second))
-- the URL of the README.md that we desire
readmeUrl : String
readmeUrl = "http://package.elm-lang.org/packages/elm-lang/core/latest/README.md"
@yogsototh
Copy link
Author

I get the following error at runtime:

undefined is not an object (evaluating 'node.kids.forEach')
Open the developer console for more details.

But I find nothing interesting in the console.

@yogsototh
Copy link
Author

It appears it only occurs in elm-reactor in debug mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment