ahmadawais / WPGulp

An advanced Gulp workflow for WordPress development with extensive documentation. Used by 40,000+ themes and plugins.
https://twitter.com/MrAhmadAwais/
MIT License
1.76k stars 303 forks source link

Browsersync localhost:3000 doesnt work #110

Open justlevine opened 5 years ago

justlevine commented 5 years ago

Bug Report

Expected Behavior

Visiting localhost:3000 should load the BrowserSync-ed version of the website.

Actual Behavior

Visiting localhost:3000 gives you an ERR_CONNECTION_CLOSED. Visiting the External Url works as expected.

Steps to Reproduce

  1. Edit your wpgulp.config.js project url.
  2. (Optional) set browserAutoOpen: true
  3. type npm start
  4. If you didn't set browserAutoOpen to true, then visit localhost:3000
  1. node -v: 8.11.1
  2. npm -v: 5.6.0
  3. browser-sync: @2.24.7

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version (if relevant): Chrome v68

Possible Solution

Edit gulpfile.babel.js in line 86 browserSync.init: proxy: config.projectURL => host: config.projectURL and add proxy: 'http://yoursite.test'

ahmadawais commented 5 years ago

Is it still the same since the last two versions? I mean try now, WPGulp has been updated. Also can you use ``` to write code for the solution and explain what you did there?

AndreaBarghigiani commented 5 years ago

Strange thing it's been a while that I get a similar error. When I try to see the localhost:3000 on Firefox Developer Edition I get redirect to 0.0.0.0 where it says me that is unable to connect (I am usign 0.0.0.0:8080 as projectURL since is my dev setting).

If I go to 0.0.0.0:8080 everything works just fine but I do not have the auto reload feature activated.

Tought it was a cache problem when I emptyed it the browser is stuck at an infinite loading. At the same time I am able to see the admin panel of BrowserSync on localhost:3001.

Maybe we can understand the error from the External path? schermata 2018-12-21 alle 12 50 05

tnchuntic commented 5 years ago

I am experiencing this too :(

No code changes on my part just testing the WPGulp.

Its a bit weird because of I can access port 3001 for the browser sync UI but for the dev website its not working. UI: https://snag.gy/OplCrA.jpg Dev site: https://snag.gy/hBK1Sv.jpg

Terminal https://snag.gy/zpIAtr.jpg

commwork commented 5 years ago

I had this problem when using another terminal, with CMD or Pwershell no problem (Windows 10).

ashbryant commented 4 years ago

Yep, I'm having issues with this also (mac) I can view :3001 fine but nothing else

RyanCadby commented 4 years ago

I am having the same issue, wpgulp works on my windows pc but does not work on my mac. Everything seems to compile fine but the browser just refreshes endlessly... I have cleared my dns cache and changed my host file. nothing seems to work

elharony commented 4 years ago

For anyone still facing this issue, it's because the projectURL wrong value.

How do you access your WordPress Project? Let's say it's inside xampp/htdocs/projects/new-wordpress-site/ and in order to access it using localhost, you type: localhost/projects/new-wordpress-site/.

Copy that path, and give it to projectURL so it can access your Project Files.

projectURL: 'localhost:3000'projectURL: 'localhost:3001'projectURL: 'localhost'projectURL: '127.0.0.1' ✔️ projectURL: 'http://localhost/projects/new-wordpress-site/'