QuiiBz / next-international

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

Build issues (Export encountered errors on following paths: /_not-found) #262

Closed Pavelas closed 10 months ago

Pavelas commented 10 months ago

Describe the bug It's impossible to build the app because for some reasons it throws an error.

 ✓ Creating an optimized production build
 ✓ Compiled successfully
 ✓ Linting and checking validity of types
 ✓ Collecting page data
   Generating static pages (0/4)  [    ]Error: Could not find locale while pre-rendering page, make sure you called `setStaticParamsLocale` at the top of your pages

Error occurred prerendering page "/_not-found". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Could not find locale while pre-rendering page, make sure you called `setStaticParamsLocale` at the top of your pages

> Export encountered errors on following paths:
    /_not-found

To Reproduce pnpm build

Expected behavior It should build without any errors.

About (please complete the following information):

QuiiBz commented 10 months ago

Can you share a minimal reproduction? Looking at the error, it seems like you're never calling setStaticParamsLocale: https://next-international.vercel.app/docs/app-static-rendering#static-rendering

QuiiBz commented 10 months ago

Closing for now, happy to re-open and help when we have more information.