QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.25k stars 59 forks source link

[Bug] setStaticParamsLocale(locale) -> RangeError: Maximum call stack size exceeded #255

Closed gustaveWPM closed 10 months ago

gustaveWPM commented 10 months ago

Describe the bug This error occurs during the build phase, when calling the yarn build command, during the Generating static pages step.

This error does not occur when using Next.js v13.5.3, but occurs when using Next.js v >= 13.5.4

I've removed all my code, except the

To Reproduce

  1. Clone the next-international-issue branch from: https://github.com/Tirraa/dashboard_rtm/tree/next-international-issue
  2. yarn install
  3. yarn build

The error then occurs. :/

You can inspect the following files, causing the crash:

If necessary, I will try to create a more minimalistic repo, to have a more precise bug reproduction this week-end.

(Maybe this bug is more related to Next.js than Next International, idk.)


next-international version: >= 1.1.2 (I haven't tested the older versions) Next.js version: >= 13.5.4

QuiiBz commented 10 months ago

This error does not occur when using Next.js v13.5.3, but occurs when using Next.js v >= 13.5.4

Sounds like a Next.js bug then 😅 I'll check this weekend.

QuiiBz commented 10 months ago

Small update: setStaticParamsLocale() should be called in pages, not layouts. That's not the case for pages inside dashboard.

Indeed, next@13.5.3 works fine but next@13.5.4 breaks. I've installed each canary between these two versions and found that it starts breaking in 13.5.4-canary.9 - I'd recommend to open an issue on Next.js' GitHub repository as it doesn't seems related to next-international (at least not directly).

gustaveWPM commented 10 months ago

Small update: setStaticParamsLocale() should be called in pages, not layouts. That's not the case for pages inside dashboard.

Indeed, next@13.5.3 works fine but next@13.5.4 breaks. I've installed each canary between these two versions and found that it starts breaking in 13.5.4-canary.9 - I'd recommend to open an issue on Next.js' GitHub repository as it doesn't seems related to next-international (at least not directly).

Thank you so much! This seems to be related to: https://github.com/vercel/next.js/issues/56614

rjnls commented 10 months ago

I have experienced a slightly different version of this bug with material-tailwind that only occurred during runtime in the browser console. Builds worked, "run dev" worked, solution was the same, everything works in 13.5.3. Even just <Card>Hi</Card> using material-tailwind caused it but for me only after a deployment, not during the build. Hope this helps.

gustaveWPM commented 10 months ago

I have experienced a slightly different version of this bug with material-tailwind that only occurred during runtime in the browser console. Builds worked, "run dev" worked, solution was the same, everything works in 13.5.3. Even just Hi using material-tailwind caused it but for me only after a deployment, not during the build. Hope this helps.

Thank you! I'm also using Material Tailwind (and currently migrating to NextUI). Wait & see...