evancz / elm-architecture-tutorial

How to create modular Elm code that scales nicely with your app
https://guide.elm-lang.org/
BSD 3-Clause "New" or "Revised" License
4.17k stars 738 forks source link

Debugger not available from example 5 onwards - better error message #34

Closed alltonp closed 8 years ago

alltonp commented 9 years ago

Hi,

Firstly, thank you for Elm! I'm new to it, just finding my way around. I was playing with the early examples and enjoying the time travel debugger, until I hit example 5...

On example 5, if I run it in non debug mode it works as expected, but if use http://localhost:8000/Main.elm?debug then I get the following error:

"Cannot read property 'forEach' of undefined Open the developer console for more details."

After some digging (on IRC), I understand that this is because this example has ports and the debugger does not (cannot?) support that, presumably because of purity.

This took me a while to figure out, so maybe a note in the readme or someway to indicate that in the error message might help others ...

Many thanks

p.

wsmoak commented 8 years ago

I ran into this as well, example 1 worked fine and then I skipped to 8, and the url in the readme [1] does not work. I'll see about sending a PR to remove ?debug from the urls for the ones that can't use it.

[1] http://localhost:8000/Main.elm?debug

evancz commented 8 years ago

Sorry for the trouble. It should not be this way in 0.17 when you follow http://guide.elm-lang.org/