Is compatible serverless-nextjs with Nextjs 10 multilang web?
See original GitHub issueHi I have a doubt, I migrate to Nextjs 10 and now I replaced Component.getInitialProps by export async function getStaticProps (to use router.locale in localhost this works fine! But in Production (AWS CloudFront) this breaks the web app. This webapp is a multi-lang Nextjs webapp (Now I am using Nextjs i18n ) I added this code:
export async function getStaticProps({locale}) {
console.log("server business");
const response = await import(`../lang/${locale}`);
return {
props: {
business: response.default.business,
bannerCookies: response.default.bannerCookies,
contact: response.default.contact,
routes: response.default.routes,
language: locale
}
}
}
And I cannot see anything in my webapp. Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:17 (1 by maintainers)
Top Results From Across the Web
Advanced Features: Internationalized Routing - Next.js
js has built-in support for internationalized (i18n) routing since v10.0.0 . You can provide a list of locales, the default locale, and domain-specific...
Read more >Frequently Asked Questions - Serverless Nextjs
Frequently Asked Questions · My component doesn't deploy# · Should I use the serverless-plugin or this component? · How do I interact with...
Read more >Next.js 10.2 - Hacker News
I don't have access to the Next.js telemetry data, ... one cannot host a multi-language site on a free hosting solution like GitHub...
Read more >Next.js - Multi Language - YouTube
In this episode we are going to make our # Nextjs and #Strapi site be multilingual.Now I'm going to show you how to...
Read more >Awesome Nextjs Overview
Nextatic (⭐42) - Static website multi-language boilerplate with user-editable pages and navigation using Netlify CMS + Next.js + SCSS + Typescript.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi!
Did anyone achieve this without using another library (just using the i18n functionality of next.js v10)? It seems to work fine with all the locales except for the default one, which does not work when I use server side navigation (it returns 404 in the subpages unless I add the prefix of the default locale).
Here is a link to my Next.js v10 i18n serverless-nextjs starter:
https://github.com/linaro-marketing/serverless-nextjs-i18n-ssg-ssr-starter