gatsby-plugin-intl
gatsby-plugin-intl copied to clipboard
Value for intl.Locale is Incorrect on Build (SSR)
After the latest update, I noticed that on SSR builds yarn build
the value for intl.locale
is incorrect.
CodeSandbox https://codesandbox.io/s/gatsby-starter-default-fx5gw?fontsize=14
The setup is I have two languages: [en-us, es-es]
. The default language is set to en-us
. Everything works as expected in development mode yarn develop
. However, running yarn build
and logging out the value of intl.locale
from either useIntl
or injectIntl
shows that durring the SSR pass on the build, the value is incorrect.
Expected
intl.locale value is: en-us
intl.locale value is: es-es
Actual
intl.locale value is: en-us
intl.locale value is: en
It's worth noting that the new version of react-intl
sets a defaultLocale
if one is not created. See related PR #80
This issue seems to somehow not occur with node 13.x ( works with 13.1.0 at least), as far as I have tested. It was definitely occuring on Node 12.x So upgrading (if possible) might solve the problem for you.
I can confirm a problem on node 12.