Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing is not working in Next 14 !! #1617

Closed
3 tasks done
issam-seghir opened this issue Dec 18, 2024 · 4 comments
Closed
3 tasks done

Routing is not working in Next 14 !! #1617

issam-seghir opened this issue Dec 18, 2024 · 4 comments
Labels
bug Something isn't working reproduction-missing unconfirmed Needs triage.

Comments

@issam-seghir
Copy link

Description

i have two language "ar" and "en" ,
i use the app router template to reproduce it
this is my reproduction : https://github.com/issam-seghir/almotasawiqV2

i only change the i18 to add Arabic and English
see files : routing , reqeust , middleware

when i go to new route for example: http://locahost:3000/business

in Arabic it will be : http://locahost:3000/ar/arbusiness
in English it will be : http://locahost:3000/ar/enbusiness

it adds the local to the route name combine them which redirect to no found page!!!

Verifications

Mandatory reproduction URL

https://github.com/issam-seghir/almotasawiqV2

Reproduction description

copy template
pnpm install
add folder routes
add my config to i18 (routing, request , middlwar )
add navbar with Link (i18) component

Expected behaviour

the Link component must go to the currect router ,
for example : /business
should go to : http://locahost:3000/ar/business not http://locahost:3000/ar/arbusiness

@issam-seghir issam-seghir added bug Something isn't working unconfirmed Needs triage. labels Dec 18, 2024
Copy link

Thank you for your report!

Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically.

Templates:

Creating a good reproduction takes time.

To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you.

Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:

  1. Open reproduction
  2. Click on …
  3. See error: …

Thank you for your understanding!

FAQ

"I've included a reproduction, what is missing?"

This comment might have been added because your reproduction doesn't point to a destination where the issue can be reproduced. Please make sure that the latest changes were saved in the reproduction and that the link is correct.

@issam-seghir
Copy link
Author

@amannn
Why do you think the reproduction is not complete?
I'm using app router template and just adding new routes in the i18 config!!

btw the routing works fine when i dont use local object:

for example:

This is will work ✔

 pathnames: {
        "/": "/",
        "/business": "/business",
        "/terms": "/terms",
        "/privacy": "/privacy",
    },

This is Not ❌

 pathnames: {
        "/": "/",
        "/business": {
            ar : "للأعمال",
            en: "business",
        },
        "/terms": {
            ar : "شروط",
            en: "terms",
        },
        "/privacy":  {
            ar : "خصوصية",
            en: "privacy",
        },
    },

when i go to new route for example: http://locahost:3000/business

in Arabic it will be : http://locahost:3000/ar/arللأعمال
in English it will be : http://locahost:3000/ar/enbusiness

@amannn
Copy link
Owner

amannn commented Dec 20, 2024

The reproduction at https://github.com/issam-seghir/almotasawiqV2 is just a mere copy of the default bug template and doesn't contain any code that demonstrates the error.

One thing I notice when looking at your pathnames above is that they don't start with a forward slash—maybe that's the cause of your bug.

@issam-seghir
Copy link
Author

Whoops, my bad! I thought I was pushed , but I wasn't. Adding a forward slash fixed my issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reproduction-missing unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants