lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.21k stars 85 forks source link

Crash in node v8.1.0 #66

Closed CrisLi closed 7 years ago

CrisLi commented 7 years ago

OS: MacOS 10.11.6 (15G1510) Node: v8.1.0

When running ws command and access the server via the browser, the server crashed.

reproduction steps:

$ npm install -g local-web-server
$ which ws 
/Users/chris/.nvm/versions/node/v8.1.0/bin/ws
$ mkdir demo
$ cd demo
$ echo hello > index.html
$ ws
serving at http://bogon:8000, http://127.0.0.1:8000, http://10.1.15.96:8000

Open a broswer and go to http://127.0.0.1:8000

internal/streams/legacy.js:59
      throw er; // Unhandled stream error in pipe.
      ^

TypeError: Cannot convert undefined or null to object
    at Function.getPrototypeOf (<anonymous>)
    at readableAddChunk (_stream_readable.js:216:18)
    at Transform.Readable.push (_stream_readable.js:195:10)
    at Transform.push (_stream_transform.js:151:32)
    at Transform.stream._transform (/Users/chris/.nvm/versions/node/v8.1.0/lib/node_modules/local-web-server/node_modules/stream-via/lib/stream-via.js:24:14)
    at Transform._read (_stream_transform.js:190:10)
    at Transform._write (_stream_transform.js:178:12)
    at doWrite (_stream_writable.js:371:12)
    at writeOrBuffer (_stream_writable.js:357:5)
    at Transform.Writable.write (_stream_writable.js:274:11)
75lb commented 7 years ago

which version of ws are you running? What file are you trying to serve? Could you send some reproduction steps?

CrisLi commented 7 years ago

@75lb I have added reproduction steps.

75lb commented 7 years ago

ok, i see it now - thanks.. the issue is with the module which prints stats to the console.. if you run ws -f none the error will go.. meanwhile, i'll fix the issue..

75lb commented 7 years ago

fixed and released in v1.2.8.

Let me know if you find any other issues 👍