Nextra 3 uses i18n structure, and the MDX file in pages root fails to load.
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" },
]
}
unfortunately this will be not fixed, until Nextra v4
@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
@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 https://github.com/shuding/nextra/issues/2600#issuecomment-2385107206
Also cc @arno-fukuda
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.
Nextra 4 was released with new i18n https://the-guild.dev/blog/nextra-4
Closing this issue for now, feel free to share your feedback