Search code examples
elm

elm reactor http://localhost:8000/ is empty


I am just starting with Elm locally.

I did

elm init
Hello! Elm projects always start with an elm.json file. I can create them!
...
Check out <https://elm-lang.org/0.19.1/init> for all the answers!
...

Then copy into src/Main.elm from Ellie app https://ellie-app.com/new

(I also tried empty and https://github.com/elm/elm-lang.org projects)

elm reactor

And when I run the elm reactor, I see nothing at http://localhost:8000/ : browser just waits response forever, no errors in terminal, no errors or activity in browser console, just waiting.

enter image description here

enter image description here

P.S. using macBook with M1 chip, running macOS Ventura 13.3.1 (22E261). Elm 0.19.1 Trying Firefox and Chrome, no errors in Terminal or in Browser console.

P.P.S. To recreate

elm init
elm make
elm reactor

Solution

  • The solution should have been: "restart your computer".

    It was silly of me, as I had exactly .js script running, that gave descibed behavior: accepting connections, but returning nothing, and never ending connection.

    const http = require("http");
    
    const host = 'localhost';
    const port = 8000;
    
    const requestListener = function (req, res) {};
    
    const server = http.createServer(requestListener);
    server.listen(port, host, () => {
        console.log(`Server is running on http://${host}:${port}`);
    });
    

    Once I stopped that service (when restarting IDE), I got reactor accessible

    enter image description here