Skip to main content

All Questions

1 vote
2 answers
38 views

I don't get what's wrong with this react component

I'm trying to build a CRUD with MySQL and Express, and right now I'm trying to redirect the user when the username is already registered in the database, but when the error 409 happens, even after I ...
Juan Carlos Muñoz Pico's user avatar
3 votes
1 answer
129 views

React/Vite using createBrowserRouter hosted in a subdirectory does not work without a trailing slash [duplicate]

I'm using React/Vite/Express to build an app that is hosted in a subdirectory. As an example, let's say it's hosted at: https://example.com/my/app/ In my Vite config, I've set base to ./ export ...
shackleton's user avatar
1 vote
2 answers
95 views

useNavigate don't work with HOC Component

This is my first question. I am self-studying React.js, Node.js, and Express. For this reason, I am trying to create my own website where a user can register, log in, and access the page with their ...
Francesco Lo Verde's user avatar
1 vote
0 answers
33 views

URL routing on render is not working for my React and Express JS app [duplicate]

I have created a React, Express JS application. On my localhost the routing works correctly. But when I uploaded the application to Render, the routing doesn't work. For example in the image: This is ...
user avatar
0 votes
0 answers
294 views

React router V6 "catch-all" route not working in production

I have my routes all set up and the catch-all (404/not found) route works perfectly fine when in React's development mode. However, as soon as I build the application to production and host it from my ...
Casey Harper's user avatar
0 votes
0 answers
28 views

A <Route> is only ever to be used as the child of <Routes> element, never rendered directly React router v6.18.0 [duplicate]

I can't understand this error, when I change Route to Routes it tells me Type { path : string ; element : Element ; } is not assignable to type IntrinsicAttributes & RoutesProps The path property ...
Peter Free's user avatar
0 votes
1 answer
2k views

Error 404 page not found when hosting the frontend to the backend through "dist"

I am using the createBrowser of react-router dom. I am trying to host my front end to my backend in nodejs with express but every time I visit another route and refresh the page it says the cannot get ...
WILBERT RODRIGO's user avatar
0 votes
2 answers
103 views

How to handle dynamically 404 Not Found page and status code 404 using react and express?

when hit the url It redirect to custom 404 not found page If doesn't match any of the defined routes but status code is still show 200. How can I handle status code also dynamically in react ...
Bardhavar Ravindhar's user avatar
1 vote
1 answer
73 views

React-router URL endpoints returns NOT FOUND in production environment

My project is working fine in the local server environment, but since I deployed it on render.com's web server, I'm getting an empty not found page whenever I try to refresh or visit a URL with an ...
OmarAbouzeid95's user avatar
0 votes
0 answers
933 views

React-Router-Dom action() posting form problem

i have a problem with posting form data to my backend . (my backend works properly with postman but it doesn't work with frontend) here is my code's down below : App.js import { RouterProvider, ...
berk's user avatar
  • 34
1 vote
1 answer
454 views

Nested React routes won't show after refresh

I have no issue navigating to the main routes and their nested routes but issue arises within the nested routes example /register, when I try to refresh the page, the page comes up blank with no error ...
kierankdot's user avatar
0 votes
1 answer
49 views

React router dom resetting path for any path with a trailing "/" I think?

I have a react app with a node/express backend that redirects users from https://example.com to https://www.example.com. This all works well, however I'm having an issue with just two routes. My app ...
TomLV's user avatar
  • 375
4 votes
1 answer
2k views

react-router-dom (v6) Routing not working in production while working in development

I have defined all my routes in App.js file, given below <BrowserRouter> <Routes> {user && <Route path="/dashboard" element={<Dashboard />} />} <...
Protonic's user avatar
0 votes
0 answers
25 views

Why does refreshing webpage gives "Cannot GET /history"? [duplicate]

I have a website with frontend built with React.js and backend built with Node.js and Express.I copied the build directory generated by npm run build from frontend to my backend root directory so that ...
suravshrestha's user avatar
2 votes
2 answers
282 views

GET request returning html not object, route returning cannot get in Heroku server

I have a react app, using Postman for testing, to get HTTP requests runing on a Heroku server with client and server in a single root folder. After deployment, I have run into a problem with the react-...
Julie's user avatar
  • 514

15 30 50 per page