One of my page routes returns a 404 error when using the localized version, I need some help
Unanswered
Sun bear posted this in #help-forum
Sun bearOP
When I access http://localhost:3000/ro/user/3a969cff-0284-4043-b97b-dfc2eaad8a2a it works just fine, the page loads and everything
However, when using http://localhost:3000/ro/utilizator/3a969cff-0284-4043-b97b-dfc2eaad8a2a I get a 404 - page not found in the browser
Here is my navigation code which handles the paths:
https://paste.ec/paste/M7FJnHOM#zAfLPNUFAGjpj5ekmwPjlzwFbeyL+z4cZk0pRrdixvx
Here is my middleware code:
https://paste.ec/paste/kPbeU63R#UX9MkRfcysh8hs5QkqZebZEbg7N69dhQK3XT2SvhgPq
I'd like to mention that the link localization for my login and sign-up pages works.
And here's the location of the files responsible for the profile page:
However, when using http://localhost:3000/ro/utilizator/3a969cff-0284-4043-b97b-dfc2eaad8a2a I get a 404 - page not found in the browser
Here is my navigation code which handles the paths:
https://paste.ec/paste/M7FJnHOM#zAfLPNUFAGjpj5ekmwPjlzwFbeyL+z4cZk0pRrdixvx
Here is my middleware code:
https://paste.ec/paste/kPbeU63R#UX9MkRfcysh8hs5QkqZebZEbg7N69dhQK3XT2SvhgPq
I'd like to mention that the link localization for my login and sign-up pages works.
And here's the location of the files responsible for the profile page:
// src/app/[locale]/user/[userId]/client.tsx// src/app/[locale]/user/[userId]/fetch-user-data.tsx// src/app/[locale]/user/[userId]/page.tsx14 Replies
Sun bearOP
Up
Sun bearOP
Up
@Sun bear sup lmao
uhh so your question is very detailed.. but its too detailed
nobody is going thru all that code xD
also one bump per day :/
but yea, do your own investigations and try and find out what could be causing it, and show the code here.. we can help in figuring out why its breaking.. not whats breaking
Sun bearOP
I tried in different ways to solve it since yesterday, haven't found a solution to it yet, I think the issue is related to incorrect routing configuration somewhere;
- Either in the navigation file on this line:
- Either somewhere in the middleware
- Either somewhere in the profile page code (which I didn't share yet)
I tried logging the issue but the logs wouldn't show because the routing is incorrectly set-up (404 - page not found) so the page won't load when the route I'm trying to access doesn't work at all.
The code I shared is because I think you have to understand how my routing is set-up first, if you want to help me.
Anyways, I'm still trying to figure out what's causing this issue, if anyone knows what may cause it let me know, if not no worries, I'll find out what's causing it, it's just a matter of time 😁
- Either in the navigation file on this line:
"/user/profile/:userId": { en: "/user/profile/:userId", ro: "/utilizator/profil/:userId" }- Either somewhere in the middleware
- Either somewhere in the profile page code (which I didn't share yet)
I tried logging the issue but the logs wouldn't show because the routing is incorrectly set-up (404 - page not found) so the page won't load when the route I'm trying to access doesn't work at all.
The code I shared is because I think you have to understand how my routing is set-up first, if you want to help me.
Anyways, I'm still trying to figure out what's causing this issue, if anyone knows what may cause it let me know, if not no worries, I'll find out what's causing it, it's just a matter of time 😁
Sun bearOP
Up!
TLDR: When I try to access this link the page loads:
http://localhost:3000/ro/user/3a969cff-0284-4043-b97b-dfc2eaad8a2a
But when I try to access this one it doesn't it gives a 404 error page not found http://localhost:3000/ro/utilizator/3a969cff-0284-4043-b97b-dfc2eaad8a2a
TLDR: When I try to access this link the page loads:
http://localhost:3000/ro/user/3a969cff-0284-4043-b97b-dfc2eaad8a2a
But when I try to access this one it doesn't it gives a 404 error page not found http://localhost:3000/ro/utilizator/3a969cff-0284-4043-b97b-dfc2eaad8a2a
Sun bearOP
I solved it!
@Sun bear I solved it!
this is not the answer. do share the answer
Sun bearOP
I had to use rewrites in order to make it work the way I wanted it to work.