Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Handling Unsupported Languages #1048

Closed
3 tasks done
JulienCertain opened this issue May 4, 2024 · 1 comment
Closed
3 tasks done

Handling Unsupported Languages #1048

JulienCertain opened this issue May 4, 2024 · 1 comment
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@JulienCertain
Copy link

JulienCertain commented May 4, 2024

Description

Hello everyone!

I'm currently in the process of coding a landing page with i18n and a static export. However, I've encountered a problem. While I've successfully implemented support for German and English languages on my page, attempting to switch to an unsupported language via URL triggers an error on my website.

My question is: How can I effectively capture any attempt to switch to an unsupported language? I've experimented with various approaches including template , error file, global-error file, not found, 404 file, and 500 file but unfortunately, none of these solutions seem to be working as intended. Any insights or suggestions would be greatly appreciated!

Verifications

  • I've verified that the problem I'm experiencing isn't covered in the docs.
  • I've searched for similar, existing issues on GitHub and Stack Overflow.
  • I've compared my app to a working example to look for differences.

Mandatory reproduction URL

https://github.com/JulienCertain/next-intl-mvp-slug-error

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. install dependencies
  3. run "npm run dev"
  4. open url "localhost:3000/fr"

Expected behaviour

Server Error

Error: Page "/[locale]/page" is missing param "/fr" in "generateStaticParams()", which is required with "output: export" config.
This error happened while generating the page. Any console logs will be displayed in the terminal window.

@JulienCertain JulienCertain added bug Something isn't working unconfirmed Needs triage. labels May 4, 2024
@amannn
Copy link
Owner

amannn commented May 6, 2024

If you use output: 'export', you won't have a generated page for /fr. Depending on where/how you host your website, the user might receive a 404 error when requesting this pathname.

I'll move this to a discussion since this is a usage question.

Repository owner locked and limited conversation to collaborators May 6, 2024
@amannn amannn converted this issue into discussion #1052 May 6, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants