Closed MoOx closed 9 years ago
it seems the tasks/reload.js
is relaunched each time the since grunt 0.4, (it does not with 0.3.x), so the servers list is overwritten each time. Weird :panda_face:
I can confirm this bug also.
+1
same problem here
Fatal error: listen EADDRINUSE
A short term fix might be to connect to the (already running) server first, triggering the reload event via a get on a certain URL (/triggerReload?). I might take a stab at this.
Man, this sucks. Have a project on grunt 0.4 and having the same error. Would it be possible to just kill the previously-existing server so it doesn't have this error on reload or no?
@manuel-woelker please send a pull request with that change. Excellent solution that works beautifully with the latest grunt-contrib-watch. You are my hero. :D
For those who is still experiencing same problems and found this page just like I did.
Try to install npm package directly from GitHub instead of using npm repo.
npm install git://github.com/webxl/grunt-reload.git --save-dev
This suggestion is reasonable until @webxl didn't npm-published latest version. (see npm version is 0.2, but current master branch is already 0.4).
Ah! Thanks @SpeCT!
Closing due to inactivity
I've just started a new project with grunt 0.4a, & like the doc said, I run reload before watch (to start server) & reload each time my CSS change, but the 2nd reload, instead of trigger the refresh, just try to start a new server (error:
Fatal error: listen EADDRINUSE
). I made some uggly debbuging & it seems that servers are not properly stored in thevar servers
. Can this be a variable scope issue comming up with grunt 0.4 ? Or maybe a problem withserver.default
syntax (default is a reserved keyword for theswitch
) ?