broccolijs / broccoli

Browser compilation library – an asset pipeline for applications that run in the browser
https://broccoli.build
MIT License
3.33k stars 217 forks source link

Specifying a custom port via cli fails with Error #315

Closed stfsy closed 7 years ago

stfsy commented 7 years ago

Starting broccoli using the cli with the argument --port and a valid port number fails, because port is a string, but server.serve only accepts numbers.

> broccoli serve --host=0.0.0.0 --port=8000

C:\...\broccoli\lib\server.js:11
    if (typeof port !== 'number' || port !== port) throw new Error('Expected port to bind to (e.g. 4200)')
                                                   ^

Error: Expected port to bind to (e.g. 4200)
    at Object.serve (C:\cygwin64\home\Stefan\stfsy.github.io\node_modules\broccoli\lib\server.js:11:58)
    at Command.<anonymous> (C:\cygwin64\home\Stefan\stfsy.github.io\node_modules\broccoli\lib\cli.js:23:29)
    at Command.listener (C:\cygwin64\home\Stefan\stfsy.github.io\node_modules\commander\index.js:301:8)
    at emitTwo (events.js:106:13)
    at Command.emit (events.js:191:7)
    at Command.parseArgs (C:\cygwin64\home\Stefan\stfsy.github.io\node_modules\commander\index.js:615:12)
    at Command.parse (C:\cygwin64\home\Stefan\stfsy.github.io\node_modules\commander\index.js:458:21)
    at Object.broccoliCLI [as cli] (C:\cygwin64\home\Stefan\stfsy.github.io\node_modules\broccoli\lib\cli.js:56:13)
    at Object.<anonymous> (C:\cygwin64\home\Stefan\stfsy.github.io\node_modules\broccoli-cli\bin\broccoli:20:10)
    at Module._compile (module.js:541:32)
bvbg commented 7 years ago

Is there any workaround for this at the moment - other than hacking the code?

stfsy commented 7 years ago

npm i stfsy/broccoli --save-dev ? 😀

bvellacott commented 7 years ago

cheers

joliss commented 7 years ago

Thanks. Fixed and released in v1.1.1.

bvellacott commented 7 years ago

cheers