How to make Next.js i18n routing work with Pages?

I use this command to build my Next.js project:
pnpm dlx @cloudflare/next-on-pages
pnpm dlx @cloudflare/next-on-pages
And deploy:
CLOUDFLARE_ACCOUNT_ID=38bc8e8ffacb44cf6ab6293124ef8e28 wrangler pages publish .vercel/output/static
CLOUDFLARE_ACCOUNT_ID=38bc8e8ffacb44cf6ab6293124ef8e28 wrangler pages publish .vercel/output/static
My next config:
{
reactStrictMode: true,
i18n: {
locales: ['en', 'zh-TW'],
defaultLocale: 'en',
},
trailingSlash: true,
}
{
reactStrictMode: true,
i18n: {
locales: ['en', 'zh-TW'],
defaultLocale: 'en',
},
trailingSlash: true,
}
2 Replies
Vero
Vero2y ago
Hi, I’m trying to find an answer for your question, let me see if someone knows how to solve that
Vero
Vero2y ago
@mattp0123 seems like that isn’t supported yet, it’s a feature request. There is an issue reported already in the next-on-pages repo: https://github.com/cloudflare/next-on-pages/issues/28
GitHub
i18n with next-intl fails to register routes · Issue #28 · cloudf...
I tried using next-intl with next-on-pages, but I'm getting the message below: ⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project. ⚡️ The following functions were not configu...
Want results from more Discord servers?
Add your server