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

Fresh react app will not serve #3927

Closed
adammfrank opened this issue Jan 28, 2018 · 7 comments
Closed

Fresh react app will not serve #3927

adammfrank opened this issue Jan 28, 2018 · 7 comments

Comments

@adammfrank
Copy link

Is this a bug report?

Yes

Did you try recovering your dependencies?

This is a fresh project. I didn't even run yarn or npm. I just ran "create-react-app client"
yarn version: 1.3.2

Which terms did you search for in User Guide?

None because this is the most basic problem possible.

Environment

  1. node -v:
  2. npm -v:
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected):

node 8.7.0
npm 5.6.0
yarn 1.3.2
react-scripts 1.1.0

Mac OS 10.13.2
Firefox 57.0.4

Steps to Reproduce

  1. Run create-react-app and create a fresh project
  2. cd into the project and run "yarn start"

Expected Behavior

Displays a page that says something like "Welcome to React!"

Actual Behavior

First it says something is running on port 3000, when nothing is actually running on port 3000 (I have checked with lsof and netstat).
Then if I say to run on a different port, the browser window opens but nothing is served to it.
There are no errors in the console or browser.

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@gaearon
Copy link
Contributor

gaearon commented Jan 28, 2018

Does running echo $HOST in your terminal produce anything?
Seems related to #3719.

@adammfrank
Copy link
Author

echo $HOST produces nothing.

@adammfrank
Copy link
Author

Fixed! That prompted me to check my /etc/hosts, which it turns out was empty. Added 127.0.0.1 -> localhost and the issue is fixed.

@gaearon
Copy link
Contributor

gaearon commented Jan 29, 2018

cc @Timer any ideas what might’ve happened here?

@adammfrank
Copy link
Author

@gaearon I have no reason to believe this was caused by create-react-app. I've been doing other development too.

@Timer
Copy link
Contributor

Timer commented Jan 29, 2018

Hmm, given the empty /etc/hosts file, localhost probably failed to resolve to 127.0.0.1 -- we could probably attempt resolving localhost [or any passed host] to see if it bombs out, but that should never be missing from your hosts file.

It's hard to say what happened without trying, but I don't want to toy with my system:

Joes-MacBook-Pro:website joe$ cat /etc/hosts
##
# 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

Do not change this entry.

related:

@stale
Copy link

stale bot commented Nov 2, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the stale label Nov 2, 2018
@Timer Timer closed this as completed Nov 2, 2018
@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants