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

Nextra 3 uses i18n structure, and the MDX file in pages root fails to load. #3121

Open
Tracked by #2600
bazijun opened this issue Aug 15, 2024 · 5 comments
Open
Tracked by #2600

Comments

@bazijun
Copy link

bazijun commented Aug 15, 2024

Description

I'm experiencing issues with Nextra 3<3.0.0-alpha.31> when using the i18n directory structure. MDX files in the root pages directory are not loading properly.

├─ pages
│ ├─ en/
│ ├─ zh/
│ ├─ es/
│ ├─ ru/
│ ├─ test.mdx ❌

Error Message

./src/pages/test.mdx:2:1

Module not found: Can't resolve 'E:/code/capsolver-docs-v3/.next/static/chunks/nextra-page-map-test.mdx.mjs'
  1 | import { HOC_MDXWrapper } from 'nextra/setup-page'
> 2 | import { pageMap } from 'E:/code/capsolver-docs-v3/.next/static/chunks/nextra-page-map-test.mdx.mjs'
    | ^
  3 |
  4 |
  5 | import 'nextra-theme-docs/style.css'

https://nextjs.org/docs/messages/module-not-found

theme.config.tsx

export default {
  i18n: [
    { locale: "en", name: "English" },
    { locale: "zh", name: "简体中文" },
    { locale: "es", name: "Español" },
    { locale: "ru", name: "Россия" },
    { locale: "vi", name: "Tiếng Việt" },
    { locale: "de", name: "Deutsch" },
    { locale: "jp", name: "日本語" },
    { locale: "hi", name: "हिन्दी" },
    { locale: "fr", name: "Français" },
    { locale: "id", name: "Bahasa Indonesia" },
    { locale: "pt", name: "Português" },
  ]
}
@dimaMachina
Copy link
Collaborator

unfortunately this will be not fixed, until Nextra v4

@bazijun
Copy link
Author

bazijun commented Aug 16, 2024

@dimaMachina
But I really need to have a 404 page with Nav and Footer under the root path of pages. Can you give me some suggestions to achieve this requirement? Thank you very much

@dimaMachina dimaMachina mentioned this issue Sep 28, 2024
44 tasks
@dimaMachina
Copy link
Collaborator

@bazijun Hi there, would you want to try Nextra 4 with app router support and server side i18n? How to do it I described in #2600 (comment)

@dimaMachina
Copy link
Collaborator

Also cc @arno-fukuda

@arno-fukuda
Copy link
Contributor

Is there any workaround that can serve the /en/ content without locale in url and without a redirect?
Google Search Console indexing doesn't like the 307 redirect, but we don't want to change our sitemap to use /en/ as default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants