I'm having trouble with my Twitter clone, specifically receiving a 404 error despite multiple attempts to push and clear the error. I've confirmed that the URL is correct, the deployment exists, the logs show no errors, and I have the necessary permissions. I'm using React.js, and after running the build command, the frontend/dist directory is created. My vercel.json configuration and project structure are set up correctly, but I'm still facing issues.
https://twitter-clone-one-hazel.vercel.app/
my vercel.json:
{ "version": 2, "builds": [ { "src": "backend/server.js", "use": "@vercel/node" }, { "src": "frontend/package.json", "use": "@vercel/static-build", "config": { "distDir": "dist" } } ], "routes": [ { "src": "/api/(.*)", "dest": "backend/server.js" }, { "src": "/(.*)", "dest": "frontend/dist/$1" } ]}
project structure:
- /project-root
- /backend
- server.js (Entry point for the backend)
- /routes
- authRoute.js
- userRoute.js
- postRoute.js
- notificationRoute.js
- /db
- config.js
- /frontend
- /dist (React build files after running
npm run build)
- /dist (React build files after running
- /backend
- vercel.json
- package.json
please ask me if you need to pictures to understand clearly.