elm-reactor icon indicating copy to clipboard operation
elm-reactor copied to clipboard

Blank Page and Error 500 when using elm-reactor

Open peacememories opened this issue 6 years ago • 11 comments

Hello, and thanks for all your work on the elm platform :)

I have an issue that has apparently surfaced before and was fixed, in #59

I was advised to create a new issue instead of just commenting on the old one, so I've duplicated my comment here :)

On MacOS, with the latest elm-platform (0.18 if I am not mistaken), and a very simple Dice.elm:

module Dice exposing (..)

import Html exposing (Html, div, text)


main =
    div [] [ text "Hello World!" ]

About 90% of the time when I refresh the page localhost:8000/Dice.elm I am greeted with a blank page, and the console outputs the following:

[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (Dice.elm, line 0)
[Error] ReferenceError: Can't find variable: runElmProgram
	Global Code (Dice.elm:10)

The resource in question is /_compile/Dice.elm which returns an error code 500.

Apparently when I add an error to my code, the proper error description page always gets shown, so the problem seems to occur after the page has been built?

I have uninstalled and reinstalled elm-platform a few times, and originally I was using the elm binaries from Homebrew, with the same result.

There could be a problem with my setup, but if so I can't find it.

peacememories avatar Sep 25 '17 18:09 peacememories

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot avatar Sep 25 '17 18:09 process-bot

Something I hadn't done was test with other browsers, and, to my surprise it seems to only happen with Safari? Which is kind of weird because the developer tools indicate an error code in the response.

peacememories avatar Sep 25 '17 23:09 peacememories

I'm experiencing the same issue, also in Safari. Anything I can do to help debug this let me know!

Interestingly, the 500s only seem to happen when there isn't a compile error. I can reliably refresh an error page and always receive 200 (as far as I can tell).

danpalmer avatar Oct 02 '17 09:10 danpalmer

I'm also experiencing this issue, also only safari (11.0), re-installed Elm and still the same. It's weirdly inconsistent I've had moments it did work on 15 refreshes, restarted Safari, and got the error again.

rl-king avatar Oct 31 '17 20:10 rl-king

So it appears that Safari, for reasons that are beyond me, will sometimes request everything twice in rapid succession on separate TCP streams, yet it only listens to the results of the second request. The first request actually succeeds!

The second request suffers from a race condition where the first /_compile/.. request removes "it-is-safe-to-delete-this-file.js" before the second request can read it.

The actual 500 response reads like so:

A web handler threw an exception. Details:\n it-is-safe-to-delete-this-file.js: openBinaryFile: does not exist (No such file or directory)

zwilias avatar Nov 01 '17 19:11 zwilias

Oh, wow. I mean I guess a race condition should be fixed anyway, but... why, Safari?^^'

peacememories avatar Nov 01 '17 20:11 peacememories

+1 for this, driving me nuts, Version 11.0.1 (13604.3.5) still has this issue :(

mlooney avatar Nov 28 '17 19:11 mlooney

Same thing here

bryce13950 avatar Feb 13 '18 06:02 bryce13950

Same here with Safari Technology Preview (Release 60 (Safari 12.0, WebKit 13606.1.23.1)). Chrome Version 67.0.3396.99 (Offizieller Build) (64-Bit) works fine. OS: macOS High Sierra 10.13.5

trs123 avatar Jul 09 '18 17:07 trs123

Also affecting me, I would really appreciate something to address this. Safari: 11.1.2 macOS: 10.13.6

matthewess avatar Jul 22 '18 03:07 matthewess

Affecting me as well. macOS: 10.13.6 Safari: 11.1.2

Getting a 500 consistently though, makes elm-reactor unusable.

josephsweeney avatar Aug 03 '18 15:08 josephsweeney