question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is compatible serverless-nextjs with Nextjs 10 multilang web?

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
Lunnaticacommented, Dec 29, 2020

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).

2reactions
kylekirkbycommented, Dec 11, 2020

Here is a link to my Next.js v10 i18n serverless-nextjs starter:

https://github.com/linaro-marketing/serverless-nextjs-i18n-ssg-ssr-starter

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found