Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
If anyone else facing the same issue and not able to resolve event after the changes provided here @MUK-Dev then you have to make changes in the webpage config file if you are using webpack. Add the below changes
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have fairly straightforward code, easy to replicate, to try and access a nested route,
localhost:5174/home/tech
.But I'm getting the following error:
GET http://localhost:5174/home/src/index.tsx net::ERR_ABORTED 404 (Not Found)
This is the following code in
App.tsx
:And this is the following code in
index.tsx
In case you're wondering, here are the packages and versions I'm using:
Interestingly enough, I can access
/tech
if I change parent path to/
, like so:<Route path="/" element={<Home />}>
.But if I have parent path set to
/home
, like so:<Route path="/home" element={<Home />}>
, I cannot access/home/tech
.Also, what I notice is that the GET request is to
http://localhost:5174/home/src/index.tsx
instead ofhttp://localhost:5174/src/index.tsx
when I set the parent path to/home
, which throws a 404 Not Found error.Does this mean that parent/root path must always be
/
?Does anyone know why this is happening? Could this be a bug in react-router-dom?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions