elm-lang / elm-reactor

Interactive development tool that makes it easy to develop and debug Elm programs.
BSD 3-Clause "New" or "Revised" License
428 stars 63 forks source link

Non-ASCII characters in code prevent hotswapping #43

Closed jastice closed 9 years ago

jastice commented 10 years ago

Non-ASCII characters in code prevent hotswapping in the debugger.

For example, save this as a utf-8 elm file, load it in the debugger and set it to hot-swap:

main = asText "note"

Now, change a character to an umlaut:

main = asText "nöte"

The debugger will not reload, and the javascript console throws an error:

Uncaught SyntaxError: Unexpected number

Remove the umlaut:

main = asText "nute"

The code will reload fine.

avh4 commented 9 years ago

I'm wondering if changing this line https://github.com/elm-lang/elm-reactor/blob/621d51dc3bd59a4225ec4358b8b6cd04cc24dc4e/server/Socket.hs#L27 from sendTextData to sendBinaryData might help with this problem. (I haven't had a chance to get elm-recator compiling to try this out yet.)

jastice commented 9 years ago

Verified that issue persists in Elm Platform 0.14.1

vilterp commented 9 years ago

Closing as duplicate of #68, which has a more recent code example