DEV Community

Tiago_908
Tiago_908

Posted on

Setup React with Vite

Hello guys and tech enthusiasts,
Recently I setup React with Vite. But I could only run it once the setup was over, and after I restart my vscode now I cannot run it, I dont know which port it works and besides it, I create a new component file inside src folder and imported it inside App file but no result on the browser. So please guys just help me on how to start my own project once I setup react with vite and delete the default code inside App.jsx, what must be the next step? And what is the main file I should run in order to get the result on browser, I am completely new with vite.

Oldest comments (6)

Collapse
 
germainmichaud profile image
Germain Michaud

Hi!
By default Vite server run on PORT 5173.
What happened if you run npm run dev or yarn dev or pnpm dev?
You have probably close VSCode without closing the server. So your server is still running.
You can try restarting your computer.

Collapse
 
thiago-coderr profile image
Tiago_908

even I run it for the first time, I tried to crete a new component file inside src folder and import it in App.ksx file it was not rendering bro,,, Can you help me to fix it please

Collapse
 
germainmichaud profile image
Germain Michaud • Edited

Can you show me your App.jsx?

Collapse
 
germainmichaud profile image
Germain Michaud

@thiago-coderr Did you solve the problem?

Thread Thread
 
thiago-coderr profile image
Tiago_908

ohh yeah I'm sorry bro, it's done already

Collapse
 
indrasisdatta profile image
indrasisdatta

Please kill your node process from terminal and start your project. You can access it using localhost:5173

You can use this Vite project for reference:
github.com/indrasisdatta/react-vit...