Priti's Technical Corner

December 12, 2015

Unable to reload page with gulp connect-livereload


OS – Window 7 , Browser – Chrome 47.0.2526.80m , Livereload – 2.0.8

You have set up gulp with react and when you make changes in HTML it is not getting refreshed once you hit save button. Hmm then debugging this is a challenge because console will not show any error and you will keep on looking in your code to find some issue.

After, making sure that nothing is wrong in code and googling you might end up to read unanswered threads and information here and there. I spend almost 2 days to debug and fix the issue.

Here are some steps which helps me to debug this issue

  1. http://localhost:9005/?LR-verbose – Add LR-verbose to your url
  2. In console you will see –  “LiveReload cannot connect to localhost:35729 (handshake timeout), will retry in 1000 sec.”

After maximum attempt to connect to LiveReload following error will be displayed in console(F12 in Chrome)

WebSocket connection to ‘ws://localhost:35729/livereload’ failed: Error in connection establishment:    net::ERR_CONNECTION_REFUSED

Now, we know the actual problem is setting up the WebSocket for livereload. let’s debug the network , Please note I am working on Window 7. I  defined the network rule to allow traffic to port 35729.

If this solve your problem, good ! but, it didn’t helped me so I started looking for other solution which was turning of firewall.  that’s Risky! but you have to take some risk ;)

If this solve your problem, you are lucky and I mean it !  Because, this didn’t even solved anything for me so my journey continued to read more about debugging livereload.js and reading on error ERR_CONNECTION_REFUSED ! Here is a sweet summary.

  1. Clear browser cache , cookies in chrome
  2. Run window defender
  3. Un-installed “Adware” anti virus ( anti virus are culprits sometimes, mine was free version so I did)
  4. Make sure port 80, 8080, 35729 is not blocked ( in windows netstate -na)
  5. Restart the computer
  6. run the cmd under administrator
  7. hit the command >gulp

And finally I too got lucky :).

It was a real journey with great lesson  and I will share a good info to you which is usually not highlighted in online course or tutorials.

When you are using gulp-connect you make sure you switch off the web browser extension of  LiveReload in chrome and firefox.

From livereload.js redme –  “note: if you use this middleware, you should make sure to switch off the Browser LiveReload Extension if you have it installed.”

Hope these notes might help someone. This post doesn’t ensure that it will solve but I think It will give you some direction to solve the problem.

Happy reloading!

 

 

September 15, 2015

Symfony installation error – symfony is not recognized as an internal or external command


Referring site – https://symfony.com/download to install symfony on my window 7 machine. While creating a symfony new project I faced an error message while running following command

c:\wamp\www>> php symfony new my_project

“symfony is not recognized as an internal or external command operable program or batch file”

Got puzzled as I just used symfony installer and there are no other steps I missed !.  As per my thoughts if you are on Linux machine and working as Admin then you might not face this error. But, in Window it will if you are not running the command line interface as Administrator.

Steps to solve

Exit the current command line session
Start new command line interface by choosing from properties – “Run as Administrator” .
Hit the command again

c:\wamp\www>> php symfony new my_project

On Success
=========
Preparing project…

OK Symfony 2.7.4 was successfully installed. Now you can:

Hope it help you further in exploring Symfony :)

Older Posts »

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 28 other followers

%d bloggers like this: