Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Grunt 0.4] reload task launch server each time & do not trigger refresh #13

Closed
MoOx opened this issue Nov 12, 2012 · 10 comments
Closed

Comments

@MoOx
Copy link

MoOx commented Nov 12, 2012

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 the var servers. Can this be a variable scope issue comming up with grunt 0.4 ? Or maybe a problem with server.defaultsyntax (default is a reserved keyword for the switch) ?

@MoOx
Copy link
Author

MoOx commented Nov 12, 2012

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 🐼

@iclanzan
Copy link

I can confirm this bug also.

@christiansmith
Copy link

+1

@srigi
Copy link

srigi commented Dec 11, 2012

same problem here

Fatal error: listen EADDRINUSE

@manuel-woelker
Copy link
Contributor

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.

manuel-woelker added a commit to manuel-woelker/grunt-reload that referenced this issue Dec 21, 2012
In the reload task, a request is made to
http://localhost:{port}/reloadTrigger.
If this succeeds, this emits reload messages in the running server process.
If the request fails, the server is started in the current process.
@ericclemmons
Copy link

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?

@shama
Copy link

shama commented Jan 4, 2013

@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

@SpeCT
Copy link
Contributor

SpeCT commented Jan 19, 2013

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).

@ericclemmons
Copy link

Ah! Thanks @SpeCT!

@MoOx
Copy link
Author

MoOx commented Jul 29, 2015

Closing due to inactivity

@MoOx MoOx closed this as completed Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants