3

I've checked this source https://formatjs.io/docs/react-intl#runtime-requirements , and tried to add this code

import { NumberFormat } from '@formatjs/intl-numberformat'

NumberFormat.__addLocaleData(
  require('@formatjs/intl-numberformat/dist/locale-data/en.json') // locale-data for en
)

NumberFormat.__addLocaleData(
  require('@formatjs/intl-numberformat/dist/locale-data/th.json') // locale-data for th
)

But it doesn't help, also I've added defaultLocale param :

<IntlProvider defaultLocale={locale}></IntlProvider>

to intl provider , but it also doesn't help. I have 2 languages , for en language I don't get this error , only for th language , what should I do ?

Andrey Radkevich
  • 3,012
  • 5
  • 25
  • 57

2 Answers2

1

Try upgrade your Node Version. I had 10 and moved to 14.x: Issue was gone

Jan
  • 12,992
  • 9
  • 53
  • 89
  • 1
    THANK YOU Jan! I searched for hours to find the root of this strange error message. My app worked completely fine, but this error message kept bothering me. The node.js update solved it for me. Thank you again! You completely made my day! – Nikolai Merz Nov 21 '21 at 11:19
0

Issue is with the object being utilized.

Check the object structure of translation content.

IntlProvider should have messages property whose value should be an object which contains property mentioned in id of FormattedMessage

Yuvraj Patil
  • 7,944
  • 5
  • 56
  • 56