yeoman / generator-webapp

A gulp.js generator for modern webapps
3.77k stars 708 forks source link

Livereload crash #179

Closed mrtonyhuynh closed 10 years ago

mrtonyhuynh commented 10 years ago

Using gulp serve or gulp watch lead to crash the livereload if some file have changed. At first I think my livereload faulty. I tried with generator-webapp (using grunt) then everything is fine, I'm afraid connect-livereload or gulp-livereload may cause.

Error message (with gulp watch)

... Uhoh. Got error listen EADDRINUSE ...
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at Server.listen (net.js:1138:5)
    at Server.listen (E:\workspace\3\node_modules\gulp-livereload\node_modules\t
iny-lr\lib\server.js:138:15)
    at Object.module.exports.exports (E:\workspace\3\node_modules\gulp-livereloa
d\gulp-livereload.js:26:14)
    at Gulp.<anonymous> (E:\workspace\3\gulpfile.js:128:20)
    at module.exports (E:\workspace\3\node_modules\gulp\node_modules\orchestrato
r\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (E:\workspace\3\node_modules\gulp\node_modules
\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (E:\workspace\3\node_modules\gulp\node_modules
\orchestrator\index.js:214:10)

Livereload log

LiveReload v0.9.2.0 says hi.
OS version: Microsoft Windows NT 6.1.7601 Service Pack 1
Paths:
  resourcesDir  = "C:\Users\admin\AppData\Local\Apps\2.0\Z4PZWOTC.OQB\XE4GH6GX.0VD\live..tion_0000000000000000_0000.0009_5dc6c1ec10bbd245\res"
  appDataDir    = "C:\Users\admin\AppData\Roaming\LiveReload\"
  logDir        = "C:\Users\admin\AppData\Local\LiveReload\Logs"
OUTGOING: ["app.init",{"resourcesDir":"C:\\Users\\admin\\AppData\\Local\\Apps\\2.0\\Z4PZWOTC.OQB\\XE4GH6GX.0VD\\live..tion_0000000000000000_0000.0009_5dc6c1ec10bbd245\\res","appDataDir":"C:\\Users\\admin\\AppData\\Roaming\\LiveReload\\","rubies":[{"version":"1.9.3","path":"C:\\Users\\admin\\AppData\\Local\\LiveReload\\Bundled\\ruby-1.9.3"}],"logDir":"C:\\Users\\admin\\AppData\\Local\\LiveReload\\Logs","version":"0.9.2.0","build":"beta","platform":"windows"}]
OUTGOING: ["projects.updateModelFromNative",{"projects":[]}]
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:cli {"command":"rpc","subcommand":"server","argv":[]}
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue Registered handler action:rescan-plugins with ID keys ["action"]
INCOMING: ["app.request_model",{}]
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue Adding Job(id = action:rescan-plugins, handler = action:rescan-plugins, request = action:rescan-plugins)
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:session Updated monitoring filter (after including all compilable extensions): 
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue Adding Job(id = action:rescan-plugins, handler = action:rescan-plugins, request = action:rescan-plugins)
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue Found existing Job(id = action:rescan-plugins, handler = action:rescan-plugins, request = action:rescan-plugins)
INCOMING: ["rpc",{"#app":{"status":"Idle. 0 browsers connected. 0 changes, 0 files compiled, 0 refreshes so far."}}]
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue Merged the old job into the new one: Job(id = action:rescan-plugins, handler = action:rescan-plugins, request = action:rescan-plugins)
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue executeNextJob
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue Running Job(id = action:rescan-plugins, handler = action:rescan-plugins, request = action:rescan-plugins)
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Scanning plugin folder: "C:\\Users\\admin\\AppData\\Local\\LiveReload\\Bundled\\plugins"
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\CoffeeScript.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\Eco.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\HAML.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\IcedCoffeeScript.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\Jade.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\LESS.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\SASS.lrplugin with 2 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\SLIM.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\Stylus.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:plugins Loaded manifest at C:\Users\admin\AppData\Local\LiveReload\Bundled\plugins\TypeScript.lrplugin with 1 compilers
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:session Updated monitoring filter (after including all compilable extensions): **/*.coffee/** **/*.eco/** **/*.haml/** **/*.iced/** **/*.jade/** **/*.less/** **/*.sass/** **/*.scss/** **/*.sass/** **/*.scss/** **/*.slim/** **/*.styl/** **/*.ts/**
STDERR: Sat, 02 Aug 2014 04:20:43 GMT jobqueue executeNextJob
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:rpc App to Node: ["app.init",{"resourcesDir":"C:\\Users\\admin\\AppData\\Local\\Apps\\2.0\\Z4PZWOTC.OQB\\XE4GH6GX.0VD\\live..tion_0000000000000000_0000.0009_5dc6c1ec10bbd245\\res","appDataDir":"C:\\Users\\admin\\AppData\\Roaming\\LiveReload\\","rubies":[{"version":"1.9.3","path":"C:\\Users\\admin\\AppData\\Local\\LiveReload\\Bundled\\ruby-1.9.3"}],"logDir":"C:\\Users\\admin\\AppData\\Local\\LiveReload\\Logs","version":"0.9.2.0","build":"beta","platform":"windows"}]
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:cli:rpc Initializing LiveReload backend with folders: {"resourcesDir":"C:\\Users\\admin\\AppData\\Local\\Apps\\2.0\\Z4PZWOTC.OQB\\XE4GH6GX.0VD\\live..tion_0000000000000000_0000.0009_5dc6c1ec10bbd245\\res","appDataDir":"C:\\Users\\admin\\AppData\\Roaming\\LiveReload\\","logDir":"C:\\Users\\admin\\AppData\\Local\\LiveReload\\Logs","version":"0.9.2.0","build":"beta","platform":"windows"}
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:context setupRuntime: version = 0.9.2.0, paths.appData = C:\Users\admin\AppData\Roaming\LiveReload\
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:whiteblack Final list of monitored filespecs: **/*.html/** **/*.htm/** **/*.shtml/** **/*.xhtml/** **/*.asp/** **/*.aspx/** **/*.ascx/** **/*.master/** **/*.cfc/** **/*.cfm/** **/*.cfml/** **/*.as/** **/*.swf/** **/*.hx/** **/*.css/** **/*.js/** **/*.jpg/** **/*.png/** **/*.gif/** **/*.svg/** **/*.ico/** **/*.txt/** **/*.md/** **/*.mdown/** **/*.markdown/** **/*.smarty/** **/*.rst/** **/*.textile/** **/*.php/** **/*.php4/** **/*.php5/** **/*.phtml/** **/*.inc/** **/*.module/** **/*.info/** **/*.tpl/** **/*.tmpl/** **/*.ctp/** **/*.twig/** **/*.ss/** **/*.class/** **/*.jar/** **/*.war/** **/*.par/** **/*.jsp/** **/*.jspf/** **/*.groovy/** **/*.gsp/** **/*.ftl/** **/*.jst/** **/*.tag/** **/*.py/** **/*.rb/** **/*.erb/** **/*.ejs/** **/*.rhtml/** **/*.rabl/** **/*.ini/** **/*.json/** **/*.properties/** **/*.conf/** **/*.yml/** **/*.yaml/** **/*.xml/** **/*.xsl/** **/*.xslt/** **/*.liquid/** **/*.mustache/** **/*.hbs/** **/*.handlebars/** **/*.rst/** **/*.hamlc/** **/*.phaml/** **/*.soy/** **/*.gss/** **/*.dust/** **/*.pl/** **/*.sh/** **/*.tcl/** **/*.clj/** **/*.scala/** **/*.lua/** **/*.cgi/** **/*.bf/** **/*.mb/** **/*.unl/** **/*.i/** **/*.3i/** **/*.neon/** **/*.pt/** **/*.js-pt/** **/*.css-pt/** **/*.mpt/** **/.htaccess/** **/*.po/** !**/.git/** !**/.hg/** !**/.svn/** !**/CVS/** !**/.DS_Store/** !**/.sass-cache/** !**/.metadata/** !**/node_modules/**
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:core:session Updated monitoring filter (after including all compilable extensions): **/*.coffee/** **/*.eco/** **/*.haml/** **/*.iced/** **/*.jade/** **/*.less/** **/*.sass/** **/*.scss/** **/*.sass/** **/*.scss/** **/*.slim/** **/*.styl/** **/*.ts/** **/*.html/** **/*.htm/** **/*.shtml/** **/*.xhtml/** **/*.asp/** **/*.aspx/** **/*.ascx/** **/*.master/** **/*.cfc/** **/*.cfm/** **/*.cfml/** **/*.as/** **/*.swf/** **/*.hx/** **/*.css/** **/*.js/** **/*.jpg/** **/*.png/** **/*.gif/** **/*.svg/** **/*.ico/** **/*.txt/** **/*.md/** **/*.mdown/** **/*.markdown/** **/*.smarty/** **/*.rst/** **/*.textile/** **/*.php/** **/*.php4/** **/*.php5/** **/*.phtml/** **/*.inc/** **/*.module/** **/*.info/** **/*.tpl/** **/*.tmpl/** **/*.ctp/** **/*.twig/** **/*.ss/** **/*.class/** **/*.jar/** **/*.war/** **/*.par/** **/*.jsp/** **/*.jspf/** **/*.groovy/** **/*.gsp/** **/*.ftl/** **/*.jst/** **/*.tag/** **/*.py/** **/*.rb/** **/*.erb/** **/*.ejs/** **/*.rhtml/** **/*.rabl/** **/*.ini/** **/*.json/** **/*.properties/** **/*.conf/** **/*.yml/** **/*.yaml/** **/*.xml/** **/*.xsl/** **/*.xslt/** **/*.liquid/** **/*.mustache/** **/*.hbs/** **/*.handlebars/** **/*.rst/** **/*.hamlc/** **/*.phaml/** **/*.soy/** **/*.gss/** **/*.dust/** **/*.pl/** **/*.sh/** **/*.tcl/** **/*.clj/** **/*.scala/** **/*.lua/** **/*.cgi/** **/*.bf/** **/*.mb/** **/*.unl/** **/*.i/** **/*.3i/** **/*.neon/** **/*.pt/** **/*.js-pt/** **/*.css-pt/** **/*.mpt/** **/.htaccess/** **/*.po/** !**/.git/** !**/.hg/** !**/.svn/** !**/CVS/** !**/.DS_Store/** !**/.sass-cache/** !**/.metadata/** !**/node_modules/**
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:rpc App to Node: ["projects.updateModelFromNative",{"projects":[]}]
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:websockets WebSocket server listening on port 35729.
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:rpc Node to App: ["app.request_model",{}]
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:rpc Node to App: ["rpc",{"#app":{"status":"Idle. 0 browsers connected. 0 changes, 0 files compiled, 0 refreshes so far."}}]
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:cli:rpc Backend is up and running.
STDERR: Sat, 02 Aug 2014 04:20:43 GMT livereload:stats Pinging server... (http://ping.livereload.com/news.json?apiver=1&platform=windows&v=0.9.2.0&iv=0.9.2.0&scheduled=0)
STDERR: Sat, 02 Aug 2014 04:20:44 GMT livereload:stats Server ping successful, response code = 200
INCOMING: Serving livereload.js.
STDERR: Sat, 02 Aug 2014 04:20:57 GMT livereload:server LRWebSocketConnection(C1) received {"command":"hello","protocols":["http://livereload.com/protocols/official-6","http://livereload.com/protocols/official-7"],"ver":"2.0.8","snipver":"1"}
INCOMING: ["rpc",{"#app":{"status":"Idle. 1 browser connected. 0 changes, 0 files compiled, 0 refreshes so far."}}]
STDERR: Sat, 02 Aug 2014 04:20:57 GMT wsio:hybi websocket writing {"command":"hello","protocols":["http://livereload.com/protocols/connection-check-1","http://livereload.com/protocols/official-7","http://livereload.com/protocols/saving-1"],"id":"com.livereload.LiveReload","name":"LiveReload","version":"3.0.0"}
INCOMING: ["workspace.set_monitoring_enabled",true]
STDERR: Sat, 02 Aug 2014 04:20:57 GMT livereload:rpc Node to App: ["rpc",{"#app":{"status":"Idle. 1 browser connected. 0 changes, 0 files compiled, 0 refreshes so far."}}]
STDERR: Sat, 02 Aug 2014 04:20:57 GMT livereload:rpc Node to App: ["workspace.set_monitoring_enabled",true]
STDERR: Sat, 02 Aug 2014 04:20:57 GMT livereload:server LRWebSocketConnection(C1) received {"command":"info","plugins":{"less":{"disable":false,"version":"1.0"}},"url":"http://localhost:9000/"}
STDERR: Sat, 02 Aug 2014 04:20:57 GMT livereload:core:session Ignoring unknown command info: {"command":"info","plugins":{"less":{"disable":false,"version":"1.0"}},"url":"http://localhost:9000/"}
STDERR: 
STDERR: events.js:72
STDERR:         throw er; // Unhandled 'error' event
STDERR:               ^
STDERR: Error: read ECONNRESET
STDERR:     at errnoException (net.js:901:11)
STDERR:     at TCP.onread (net.js:556:19)
Node.js appears to have crashed.
LiveReload says bye.
silvenon commented 10 years ago

The error message states that it's in use. Do you have another server or livereload plugin running? This happened to me until I figured out I have a livereload app running, it took me a while to figure it out the first time :P

mrtonyhuynh commented 10 years ago

I do not have any other app use livereload, but this is still happening. Strange that, I try to use generator-webapp and it don't have any problems.

Did I have something mistake?

Error Message

silvenon commented 10 years ago

You should close the LiveReload for Windows you downloaded, you only need the Chrome plugin for this generator. Did you try with the LiveReload closed?

mrtonyhuynh commented 10 years ago

If close Livereload for Windows, cannot activate livereload chrome extension. ERROR That means that livereload inoperable. And console log return error msg: Error: Failed to load resource: net::ERR_CONNECTION_REFUSED I find it hard to understand why Grunt runs fine, but fail with Gulp. =.="

silvenon commented 10 years ago

Yes, it indeed doesn't make sense why it works with Grunt. You don't even need the LiveReload Chrome extension for it to work, because the livereload package injects the same (or a similar) script to your page. Without touching the LiveReload extension, when you run gulp watch and the browser tab opens, does the LiveReload work or does the error above appear?

mrtonyhuynh commented 10 years ago

Wow, gulp watch work like a charm without LiveReload Extension & Application Running. Thank you very much!

silvenon commented 10 years ago

I didn't notice you were running gulp serve instead of gulp watch, that was the problem all along :)