Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
How to build dynamic routes with internationalized routes (i18n) using Next.js without getStaticPaths?

I’m trying to find a solution for building simple dummy dynamic routes to have something like: /order/{productid}.

Next allows us to take different strategies, but in order to achieve what I need it seems, I saw two possibilities:

  1. Static paths generation: Since I have around 1400+ products, static generation for it would only make sense if I could use ISR, so I could fetch only a few offers and leave the rest to be incrementally generated using ISR. Unfortunately my usecase doesn't allow me to use ISR since I'm in Europe and the lambdas created by this feature are in the US, and this is a restriction for me.

  2. basic dynamic routing : I tried to run dummy examples with dynamic routes, but when doing this with i18n setup, it falls into an infinite loop. I tried really hard to research about it and I found nothing useful.

What have I tried? I took this example https://nextjs.org/docs/routing/dynamic-routes and added i18n to the docs example so that I could showcase the issue.

You can find it here: https://github.com/sergioviniciuss/next-dynamic-routing-i18n

Please, any ideas are welcome.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The issue was actually because I was passing the port in my i18n domains config. For localhost, I was passing also the port, and that was causing an infinite loop:

    domains: [
      {
        domain: 'localhost:3000',
        locales: [
          "de-DE",
          "de-AT",
          "en-US",
          "en-IE",
          "en-GB",
          "nl-NL",
          "es-ES",
          "fr-FR",
        ],
        defaultLocale: process.env.APP_LOCALE || "en-US",
        http: true,
      },
    ],

So instead of domain: 'localhost:3000', it should be domain: 'localhost',

And it works like a charm.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!