Vite integration on pre-existing react project.. 404 but dev server running
This is the existing project: https://github.com/nnall/CRUDApps/tree/main/signup
Because the backend is already set up in my current project, I'm reluctant to scrap it and use
npm create vite@latest
to create a whole new react project through the vite command.
I merely want to integrate it, like an npm package, and run the vite server as my dev server, which I appear to be doing (see pic) according to the terminal output when I run this script: "start": "npx vite",
.
But the browser at that address is giving me a 404 error.
This is my config file:
and the npm packages:
GitHub
CRUDApps/signup at main · nnall/CRUDApps
Server learning apps. Contribute to nnall/CRUDApps development by creating an account on GitHub.
7 Replies
What is the issue with using the create vite command and then moving the files into that project?
Get away from CRApp and just use Vite from the start.
ok, yea was just thinking that.. but wasn't sure if that would break the ability to run the server or something, I guess not though
What server?
Not seeing that part in your project xD
?
not a 'server' a db connection
🤷♂️ I'm only seeing what you shared so
if you are going to use a server/db I would use NextJS or Remix
As per React docs
But yea it should not matter if you are using Vite or CRApp since you are decoupled already.
ok. but in terms of just creating this 3d front end, it doesn't matter that I'm not currently using NextJS right?
I can still just create a new project from scratch and add my existing files to that and be okay?
If you are doing a fullstack app I think its best to use yes. (Remix does it better imo)
Remix was made by the same folks at React-Router it should be noted too.. Fixing the mistake that is it.
If I was using something other than NodeJS for BE or if you really really wanted it to be a SPA then you would just use Vite.