Create-react-app: how to run react app on vscode live server?

Created on 28 Apr 2020  路  5Comments  路  Source: facebook/create-react-app

hello guys how should i run react app on vs code liverserver as my vs code liverserver port number is 5500 and when i click go live it shows
Annotation 2020-04-28 095448
and when i open src folder and then click on index.js file . it start downloading that file...
plz help me how can i run my project on live server

needs triage stale

Most helpful comment

you don't need vs code live server
if you use create-react-app to create react app
create react app comes with hot reloading development server

open your project folder in cmd , then
npm start

it will start development server with hot reloading
http://localhost:3000/

tip:
don't use internet explorer
use chrome (it's best, and good developing tool there) or Firefox,

All 5 comments

you don't need vs code live server
if you use create-react-app to create react app
create react app comes with hot reloading development server

open your project folder in cmd , then
npm start

it will start development server with hot reloading
http://localhost:3000/

tip:
don't use internet explorer
use chrome (it's best, and good developing tool there) or Firefox,

@chwasiq0569 @karthik1704 is right you don't need live server, live server is useful when you need to run or host static assets. Create react app has a built-in server you can either run npm start in your terminal or in vscode open "npm scripts" section in the sidebar and you can click the 'start' script and it will run create react app on a server.

Screenshot 2020-05-05 at 21 48 35

run npm start then by default your app will run on http://localhost:3000/
if you want to change the port number to 5500
then do this changes in package.json file scripts
by default it will be "start": "react-scripts start"
Linux & MacOS "start": "PORT=5500 react-scripts start"
Windows "start": "set PORT=3006 && react-scripts start"

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

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adrice727 picture adrice727  路  3Comments

DaveLindberg picture DaveLindberg  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

Aranir picture Aranir  路  3Comments

ap13p picture ap13p  路  3Comments