Starting Stencil - Localhost URL Never Loads - bigcommerce

I'm new to developing with Stencil, and I'm having a bit of trouble getting started.
After running:
stencil start
I get the startup information, and ASCII graphic loading in terminal, along with the localhost URLs which should allow me to view the frontend and work on the store. Whenever I visit the http://localhost:3000 URL, nothing ever loads.
It seems that something is in fact working, because when I edit and save a SCSS file, I get a terminal line recognizing that a file was changed.
I'm running on macOS High Sierra, v. 10.13.3
I've tried uninstalling and reinstalling stencil-cli, along with the JS utilities a dozen times and also tried different versions of Node -- namely 4.4.0, 6.10.3, and 7.9.0
Is there anything else I can do to troubleshoot? I sat down with a coworker and ran through the setup on their machine and everything worked perfectly. This must be an isolated issue somehow to my machine, but I'm not sure how to proceed.
Any help would be greatly appreciated.
Thank you!

The issue was has been resolved. The following lines were completely missing from my hosts file:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

Related

localhost refused to connect - MAMP Pro

There seem to be a few questions that are similar but could not find the answer.
An hour ago (and the months before that :-)) everything was working fine. It looks like after updating to XCode 9.2 things stopped working.
I've justed updated to MacOS High Sierra 10.13.2 as there were some Apache updates included, but it didn't solve the issue. Maybe the XCode update changed something to the httpd.conf file? I'm not too familiar with the settings in there, so I'm unable to determine if something changed in that file.
Error in Chrome:
This site can’t be reached
www.example.dev refused to connect.
ERR_CONNECTION_REFUSED
My setup:
MacOS High Sierra 10.13.2
MAMP Pro 4.2 (latest version)
Ports are Apache: 80 and MySQL: 3306
VPN is off
If I run sudo nano /private/etc/hosts it has the following entries (I run my local website on www.example.dev)
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 www.example.dev # Note; I added this myself a long time ago as else the URL including www doesn't work
127.0.0.1 example.dev # MAMP PRO - Do NOT remove this entry!
::1 example.dev # MAMP PRO - Do NOT remove this entry!
What I tried:
Changing ports to default MAMP ports (Apache: 8888 and MySQL: 8889). No luck
If I run apachectl configtest in terminal it returns Syntax OK
UPDATE
Just saw that if MAMP Pro is off:
It still gives the same error in Chrome
It still returns Syntax OK with apachectl configtest
When I run sudo apachectl stop it returns /System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
UPDATE 2
Out of frustration I downloaded Firefox to check and... all my local dev sites work there! In Chrome I still get the same error, even after clearing browsing data.
Turns out, Chrome (and Safari as well) were redirecting to https, so https://www.example.dev. And the problem was the .dev TLD.
If you run into the same problem (force forward by Chrome to https) and:
You DON'T use .dev, read this post for possible solutions
You DO use .dev as your local TLD, you need to change it to something else. Chrome redirects .dev TLDs to https since version 63. See this article and your best alternative TLDs here.

MAMP crashes on launch

I've got a problem quite annoying I cannot sort out.
I am running MAMP as a localhost server. Everything was working perfectly until I had the (maybe stupid) idea to modify my /private/etc/hosts file in order to add a domain name to my IP address.
In addition to be unable to add this domain name I am now faced with a crash when I try to open the MAMP software, more precisely with the famous
"the program has unexpectedly finished"
It seems that there is a problem with the configuration since an other error message appears and disappears very quickly after I click "ignore" or "restart" but I don't have time to read it. I try to uninstall (and reinstall) MAMP but as it could be expected the problem is still there.
I don't know what to do since it still goes wrong even after I change the hosts file as it was before my first modification (or at least as I think it was before).
Does anybody could help me to fix this problem?
EDIT:
Just in case this could help, this is the content of my current hosts file:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
what is the message when you launch MAMP with command line ? /Applications/MAMP/MAMP.app/Contents/MacOS/MAMP

localhost stops working after refresh

I have a weird issue with localhost on my Mac. I'm trying to setup Apache server, but I'm just stuck with the localhost. So on a new tab if I type in localhost and press enter, it shows 'It works'. But if I then refresh the page, it only disconnects and says 'The site can't be reached. Localhost refused to connect.'
I've followed all the steps in several tutorials about setting this up but nothing solves this issue. Any thoughts?
Finally, I could make it work. I noticed that there was this line Include /private/etc/apache2/other/*.conf at the end of the httpd.conf file which was overwriting any of my other conf files, so it wasn't letting localhost work normally.
I first uncommented it and localhost worked, I could also see my directories in the browser. But then another issue came up, that the phpinfo.php page wasn't showing up the usual phpinfo, instead it was showing me the code in the file for rendering phpinfo.
After googling around I learnt that because I had upgraded my PHP earlier to version 7.1, this new installation uses a conf file inside the 'other' directory (read this) to make php work and also comments out the php5_module line in httpd.conf to disable older php. I had instead uncommented this line and commented out the line to include this other conf file. So in order to deal with both the first case and this one, I simply commented out php5_module line again and then moved this line for including other conf file to a place above where I was including my conf file. And everything worked :)

WAMP localhost redirects to my IP

I had to recently wipe my PC and I'm setting up my development environment again using WAMP.
After installing WAMP, if I visit http://localhost instead of seeing the WAMP homepage I get redirected to http://x.x.x.x, where x.x.x.x is my IP.
I had this issue on another PC and after setting the inbound rules for Apache HTTP Server in my Windows Firewall settings to allow all domains it fixed the issue. I applied this to my PC, and the issue does not seem to be present for Internet Explorer, whereas for Chrome and Firefox the localhost to my IP redirect issue persists even after clearing the cache for each browser.
My C:\Windows\System32\drivers\etc\hosts file looks like this:
127.0.0.1 localhost
::1 localhost
and my firewall rules look like this:
I am not currently using vhosts and I'm on a network at my workplace (if that has any implications?)
I also encountered the same issue when using Laragon which uses vhosts and whenever I visited a virtual host, e.g. mysite.dev it didn't work properly either.
My question on the Laragon forum: https://forum.laragon.org/topic/126/accessing-mysite-dev-redirects-to-url-which-shows-index-php-at-root-folder/3
The Problem
I'm behind a proxy which is used for browsing the web at my workplace. The proxy seemed to be messing up the dns resolution whenever I made a call to localhost (when using wamp) or one of my vhosts (when using Laragon).
This was clear as when I ran the following from the command line: ping site.dev I was getting the expected response from 127.0.0.1. However, when going to site.dev in my browser I was getting redirected to my IP, so essentially my etc/hosts file was being ignored for dns resolution.
The difference between the two being that the browser is using the proxy whereas the command line isn't!
The Solution
After trying many different solutions which seemed to work for localhost (on wamp) only, but not vhosts (on Laragon) I finally got to the solution which was actually so simple!
So, for chrome I simply went to chrome://settings/ > Network - Change proxy settings > LAN Settings > Proxy Server - Advanced
Then in the Exceptions text box I added the following:
*.dev;localhost;127.0.0.1
Here's a screenshot of my settings from Chrome/Internet Options
And that did the trick! Hope this can help someone else.

Dnsmasq stopped working for no reason

I started using Dnsmasq on OSX Yosemite to resolve all *.dev domains to 192.168.10.10 IP address, which is Laravel Homestead's default.
It worked for me, but after sleeping and waking my Macbook, it stopped working.
I have followed steps of this tutorial, at first and it worked. It seems like all needed files are still there, but now when I go to anything.dev, it loads forever and then timeouts.
I do have a dev file at /etc/resolver with following content:
nameserver 192.168.10.10
Please help.