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

stuck when starting

Open cognominal opened this issue 5 years ago • 2 comments

I wanted to try elm-live to familiarize myself with elm. I installed elm/html I created a src/Main.elm by pasting the example from the elm/html.

import Html exposing (Html, button, div, text) import Html.Events exposing (onClick)

type Msg = Increment | Decrement

view : Int -> Html Msg view count = div [] [ button [ onClick Decrement ] [ text "-" ] , div [] [ text (String.fromInt count) ] , button [ onClick Increment ] [ text "+" ] ]

Below the rest of the session from the shell on MacOs catalina. The server launch but when accessing the page from the browser, it dies. I pasted the session I don't know to go from there. It seems elm-live want to access some file. Do I need to run it from a specific place ? At the end of the session are the version number of mpm, elm, elm-live. Probably not a bug. More like a PEBCAK. Help!!! Thx for your help.

$ elm-live src/Main.elm

elm-live: Server has been started! Server details below: - Website URL: http://localhost:8000 - Serving files from: /Users/cog/git/cra

elm-live: The build has succeeded.

elm-live: Watching the following files: - src/**/*.elm

internal/fs/utils.js:427 throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path); ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined at readFile (fs.js:286:10) at /usr/local/lib/node_modules/elm-live/node_modules/crocks/Async/index.js:54:10 at Object.fork (/usr/local/lib/node_modules/elm-live/node_modules/crocks/Async/index.js:155:20) at /usr/local/lib/node_modules/elm-live/node_modules/crocks/Async/index.js:254:41 at settle (/usr/local/lib/node_modules/elm-live/node_modules/crocks/Async/index.js:151:16) at ReadFileContext.callback (/usr/local/lib/node_modules/elm-live/node_modules/crocks/Async/index.js:56:47) at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:230:13) bash-3.2$ npm --version 6.9.0 bash-3.2$ elm --version 0.19.0 bash-3.2$ elm-live --version 4.0.0-rc.1

cognominal avatar Oct 16 '19 23:10 cognominal

The program was missing a Main. I was expecting some feedback in the window.

cognominal avatar Oct 18 '19 15:10 cognominal

The file name main.html also crashes. use for example index.html and app.js )))

mb00t avatar Jul 19 '21 12:07 mb00t