Home > Blockchain >  Next Js context parameter from getStaticProps returns "{ locales: undefined, locale: undefined,
Next Js context parameter from getStaticProps returns "{ locales: undefined, locale: undefined,

Time:01-19

I am simply trying to use the context parameter from Next Js's getStaticProps function, but when I console log it, I get "{ locales: undefined, locale: undefined, defaultLocale: undefined }".

I use getStaticProps inside the pages folder as I am supposed to but I still get that weird object on all pages.

I would really appreciate any help as I was not able to find any information.

CodePudding user response:

It's totally normal, it's part of Next.js i18n routing

  • locale contains the active locale (if enabled).
  • locales contains all supported locales (if enabled).
  • defaultLocale contains the configured default locale (if enabled).

Don't worry about it if you are not using internationalisation.

  •  Tags:  
  • Related