stackgl / shader-school

:mortar_board: A workshopper for GLSL shaders and graphics programming
Other
4.28k stars 252 forks source link

Unable to start `shader-school` on Ubuntu 14.10 with node 0.11.14 #107

Closed minhnhdo closed 9 years ago

minhnhdo commented 9 years ago

Here is the log

$ shader-school

 ==============================
 = ~~~~~ shader-school ~~~~~~ =
 ==============================

[?] We're about to populate this directory with some code for you to use for
    your answers. If they've already been created then don't worry, they won't
    be replaced. Continue? Yes

Done!
Booting up the workshop in your browser in just a second...

WORKSHOP URL: http://localhost:12492

200   19ms       299B  /
200  480ms    63.29KB  /index.js ➞ $HOME/.nvm/v0.11.14/lib/node_modules/shader-school/node_modules/browserify ./index.js -d
$HOME/.nvm/v0.11.14/lib/node_modules/shader-school/node_modules/beefy/lib/handlers/bundle.js:32
    if(!(parsed.pathname in entries) && !('browserify' in parsed.query)) {
                                                                ^
TypeError: Cannot use 'in' operator to search for 'browserify' in null
    at handle ($HOME/.nvm/v0.11.14/lib/node_modules/shader-school/node_modules/beefy/lib/handlers/bundle.js:32:65)
    at handle ($HOME/.nvm/v0.11.14/lib/node_modules/shader-school/node_modules/beefy/lib/handlers/log.js:42:5)
    at beefyMainHandler ($HOME/.nvm/v0.11.14/lib/node_modules/shader-school/node_modules/beefy/lib/create-handler.js:42:12)
    at handler ($HOME/.nvm/v0.11.14/lib/node_modules/shader-school/node_modules/beefy/index.js:82:5)
    at Server.<anonymous> ($HOME/.nvm/v0.11.14/lib/node_modules/shader-school/index.js:95:14)
    at Server.emit (events.js:110:17)
    at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:491:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
    at Socket.socketOnData (_http_server.js:343:22)
    at Socket.emit (events.js:107:17)

A quick workaround is to add +'?' at the end of /index.js:32, like so

      // ...
      if (err) throw err

      var url = 'http://localhost:'+mainPort+'?' // <- added here
      opener(url)
      console.log(chalk.yellow('WORKSHOP URL:'), chalk.underline.blue(url))
      console.log()
      // ...
hughsk commented 9 years ago

Thanks for thereport @mrordinaire! I've pushed some changes which should fix the issue – could you give it a try using the following?

npm install -g stackgl/shader-school

If you're still running into problems reopen this issue and we can dig into it deeper :)