Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

debugger is broken in 0.16 #157

Closed
theburningmonk opened this issue Nov 20, 2015 · 28 comments
Closed

debugger is broken in 0.16 #157

theburningmonk opened this issue Nov 20, 2015 · 28 comments
Labels

Comments

@theburningmonk
Copy link

Just downloaded and installed 0.16 on my Mac OS X Yosemite, and Chrome 46.0.2490.86 (64-bit) and nothing is rendered (with below example) in Debug mode but works fine without debug.

import Graphics.Element exposing (..)
import Mouse
import Signal

main = Signal.map show <| Signal.foldp (\_ n -> n + 1) 0 Mouse.clicks

In debug mode, I see the following error message in Console:

Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(...) is not a function

foldp_demo.elm:6127 Uncaught TypeError: Elm.fullscreenDebug is not a function
@krisajenkins
Copy link

I suspect this is issue #145 with a different error message.

(In summary, the debugger doesn't work with ports. Yet.)

@fredcy
Copy link

fredcy commented Nov 20, 2015

I saw the same messages in an app that doesn't use ports. That's what I was discussing in #156.

fredcy added a commit to fredcy/elm-reactor that referenced this issue Nov 20, 2015
This addresses the immediate symptom reported in elm-lang#157 and potentially in elm-lang#156.
@rundis
Copy link

rundis commented Nov 21, 2015

With 0.15.1 I had plenty of stuff working fine with the debugger which isn't now. Even this trivial thing below causes the above error.

module Hello where

import Html exposing (text)

greet : String -> String
greet name = "Hello " ++ name


main : Html.Html
main =
  text (greet "Magnus!")``` 

@hkrish
Copy link

hkrish commented Nov 21, 2015

I have the same issue as well.

@evancz
Copy link
Contributor

evancz commented Nov 22, 2015

I just put a new installer on the website that should fix this. Can you redownload it and reinstall, remove any relevant elm-stuff/ directories, and then try this again? Please let me know how it goes!

@evancz evancz added the bug label Nov 22, 2015
@janraasch
Copy link

I am on OS X 10.11.1 and just installed 0.16 via the installer on the site. Running the first example from https://github.com/evancz/elm-architecture-tutorial with http://localhost:8000/Main.elm?debug any changes I make in my editor are not getting through to the browser. No error messages or even any messages really. If you let me know, how to get useful debugging output, I could post that here.

@jvoigtlaender
Copy link
Contributor

The issue here was about elm-reactor not working in debug mode at all. Is that the case for you?

Put differently, which of the following is the case for you?

  • The program doesn't run in debug mode at all. There is nothing on the browser's screen. Possibly there is an error message in the browser's JavaScript console.
  • The program does run in debug mode. There is stuff on the browser's screen. But when the editor content is changed and saved, the changes are not picked up by the program running in the browser.

The issue discussed here is about the first case. If your problem is like in the second case, then it is about something else. You may want to look at the issues in https://github.com/elm-lang/elm-reactor/milestones/Swapping then, and see whether you have something to add there.

@rundis
Copy link

rundis commented Nov 23, 2015

The original issue posted by OP is now fixed for me with the new distribution. tx !
(on a separate note, although the hotfix is great and pragmatic, shouldn't the version number have been upped (at least for elm-reactor) ?)

@janraasch
Copy link

@jvoigtlaender I see. The latter describes my case. Thank you for clearing this up.

@kaaloo
Copy link

kaaloo commented Nov 23, 2015

Built from master just now and the elm-reactor debugger is working again. Thanks @evancz !

@evancz
Copy link
Contributor

evancz commented Nov 23, 2015

Great, looks like the originally reported issue is resolved. Sorry for the trouble. We are working on a bunch of other stability improvements for the reactor, so those should be getting resolved in the next release.

@evancz evancz closed this as completed Nov 23, 2015
@hkrish
Copy link

hkrish commented Nov 23, 2015

I built from master and this issue is resolved. I have issues with onscreen "reload" button though. I will file a separate issue for that. Thank you @evancz .

@aestheticsdata
Copy link

not resolved for me. I used the last installer for osx and still have the error reported initially by theburningmonk :

Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(...) is not a function

Uncaught TypeError: Elm.fullscreenDebug is not a function

@rundis
Copy link

rundis commented Nov 28, 2015

@aestheticsdata Did you delete the elm-stuff ?

@aestheticsdata
Copy link

ok. I've just discover what the problem was.

elm-reactor

causes the debug error, but :

elm reactor

is working fine.
Why is there two different way to launch reactor ?
Thanx.

@aestheticsdata
Copy link

I have two computers, one with osx 10.10.3 and the other with 10.10.5, on both elm 0.16 is installed. On the first one, elm-reactor causes the debug to be broken, but it works correctly on the second laptop with 10.10.5

@jvoigtlaender
Copy link
Contributor

How did you install Elm on those two computers?

@jvoigtlaender
Copy link
Contributor

And was there a previous install on one of them?

@aestheticsdata
Copy link

I installed eml using the installer, not npm. Maybe there was a previous install, but it is said on the official elm site that to upgrade/uninstall : "To upgrade to a newer version of Elm, run the installer again. They safely overwrite old executables so your machine is in a consistent state."

@jvoigtlaender
Copy link
Contributor

Well, that statement is not true actually. The installers (at least on Windows, and I'm pretty sure the setup is the same on Mac OS) put new executables in new directories, and update the path environment variable to point to the new directory. Something might have gone wrong with the path updating in your case (maybe you had hand-crafted paths between the old and new install), so that an old version of the elm-reactor executable is found, and somewhere else a new version of the elm executable. Or vice versa. Can you do some calls like elm --version and elm-reactor --version and post the results? And also do something equivalent to which elm and which elm-reactor to find out what the paths are of the executables that get run in each case?

Also, you haven't answered @rundis's question above.

@jvoigtlaender
Copy link
Contributor

Had a very brief look at the Mac install maker script, and it might actually try to overwrite executables.

Still, the answers to all the questions above would be relevant.

@aestheticsdata
Copy link

to anwser to @rundis : yes I deleted the elm-stuff directory.

@aestheticsdata
Copy link

@jvoigtlaender

which elm
=> /usr/local/bin/elm

which elm-reactor
=> /usr/local/bin/elm-reactor

elm-reactor -v
=> 0.16.0

elm repl
=> ---- elm repl 0.16.0 ----

on my two computers.

Thanx.

@jvoigtlaender
Copy link
Contributor

Hmm, no explanation for me then why elm reactor behaves differently from elm-reactor. As a matter of fact, in version 0.16 (it was different in some older versions), elm is just an executable that expects a command and then runs the executable elm-command. Like git works. So a call elm reactor will let elm parse the "reactor" and issue a new call elm-reactor. I see little room there for what could go wrong. Except that when elm calls elm-reactor it somehow calls a different elm-reactor than you call yourself from the command line.

@grandsong
Copy link

I'm new and only installed v0.16.0 on my Windows 7 64x.

Here's how I workaround:

After I noticed that, in the file list page ("http://localhost:8000/"), the icon before my 'App.elm' is broken, I checked the "src" property of that , which is _"/reactor/wrench.png".

I had seen the file under my elm platform folder. So I simply copy the "_reactor" folder to my project folder and done!

I guess elm-reactor is supposed to silently use that shared folder for every project. However, it doesn't happen.

My elm platform folder is "C:\ENV\Elm". In my system Environment Variables, there is "ELM_HOME"="C:\ENV\Elm\share". I modified it into "C:\ENV\Elm\share\reactor". Neither works.

@srikumarks
Copy link

I get the following error when invoking the debugger in elm-reactor (elm 0.16)

Cannot read property 'forEach' of undefined

Open the developer console for more details.

(Similar to that reported in #145)

When I look at debugger-implementation.js#L724, it looks like we can't assume node.kids to always be an Array and it could be undefined too. If so, that line could be protected by -

node.kids && node.kids.forEach(addAllToDict);

When I do this on my local system (MacOSX El Capitan, elm 0.16) I'm able to use elm reactor. Is it a guarantee provided by some other part of the code that node.kids will always be an Array?

@frontsideair
Copy link

I'm still having the original issue with OSX/NixOS and Elm Reactor 0.16.0. Neither the NixOS build nor downloadable binary from the website (md5: 1853a29ba0e6e6b4689a6df40da01b89) seems to be working.

@larryweya
Copy link

larryweya commented May 9, 2016

I have the same experience where elm-reactor doesn't show debug but elm reactor works. I'm on OSX 10.11.4 and I just installed a fresh pkg and deleted my elm-stuff directories after.

EDIT:
After restarting my terminal, elm-reactor works as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests