wking-io / elm-live

⚡ A flexible dev server for Elm. Live reload included.
https://elm-live.com
MIT License
1.05k stars 61 forks source link

ERR_INVALID_ARG_TYPE Error in alpha #177

Closed girishso closed 5 years ago

girishso commented 5 years ago

Just trying out alpha version, I get following error. Any ideas?

> elm-live ./src/Main.elm  --open  -- --output=./src/static/elm.js

_http_server.js:302
    throw new ERR_INVALID_ARG_TYPE('options', 'object', options);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "options" argument must be of type object. Received type boolean
    at new Server (_http_server.js:302:11)
    at Object.createServer (http.js:40:10)
at /Users/XX/.config/yarn/global/node_modules/elm-live/lib/src/start.js:244:75
at /Users/XX/.config/yarn/global/node_modules/crocks/core/compose.js:8:14
at settle (/Users/XX/.config/yarn/global/node_modules/crocks/Async/index.js:151:16)
at /Users/XX/.config/yarn/global/node_modules/crocks/Async/index.js:27:62
at fork (/Users/XX/.config/yarn/global/node_modules/crocks/Async/index.js:155:20)
at /Users/XX/.config/yarn/global/node_modules/crocks/Async/index.js:224:16
at fork (/Users/XX/.config/yarn/global/node_modules/crocks/Async/index.js:155:20)
at /Users/XX/.config/yarn/global/node_modules/crocks/Async/index.js:224:16
wking-io commented 5 years ago

What Node version are you using?

wking-io commented 5 years ago

Try installing the new alpha and let me know if the issue is fixed!

girishso commented 5 years ago

Tried the new alpha, now the server starts but when accessing it in browser it crashes.

I'm on Mac btw.

╰→  elm-live --version
4.0.0-alpha.3

╰→  node -v
v12.6.0

╰→  elm-live ./src/Main.elm  --open  -- --output=./src/static/elm.js
.
.

internal/fs/utils.js:426
    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:302:10)
    at /Users/girish/.config/yarn/global/node_modules/crocks/Async/index.js:54:10
    at Object.fork (/Users/girish/.config/yarn/global/node_modules/crocks/Async/index.js:155:20)
    at /Users/girish/.config/yarn/global/node_modules/crocks/Async/index.js:254:41
    at settle (/Users/girish/.config/yarn/global/node_modules/crocks/Async/index.js:151:16)
    at ReadFileContext.callback (/Users/girish/.config/yarn/global/node_modules/crocks/Async/index.js:56:47)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:246:13)
wking-io commented 5 years ago

Do you have you project in a repo I can use to test?

wking-io commented 5 years ago

This should be fixed now! 👌