I'm using react-intl version 2.4.0 and for some translations I receive "missing message" error in console. Is there any way to handle them without upgrading to v3?
<IntlProvider
locale="ru"
messages={localeData.ru}
>
<Layout>
<Component {...props} />
</Layout>
</IntlProvider>
I'm using react-intl version 2.4.0 and for some translations I receive "missing message" error in console. Is there any way to handle them without upgrading to v3?
<IntlProvider
locale="ru"
messages={localeData.ru}
>
<Layout>
<Component {...props} />
</Layout>
</IntlProvider>
Share
Improve this question
edited Jan 21, 2020 at 11:31
Yerlan Yeszhanov
asked Dec 18, 2019 at 8:39
Yerlan YeszhanovYerlan Yeszhanov
2,43912 gold badges42 silver badges78 bronze badges
3
- What do you mean by 'handle them'? – Brett DeWoody Commented Dec 18, 2019 at 8:44
- Without upgrading to v3 it would be a little tricky. Had you happened to look at this comment github.com/formatjs/react-intl/issues/… – Sumit Surana Commented Dec 18, 2019 at 8:45
- @BrettDeWoody do not show error in console – Yerlan Yeszhanov Commented Dec 18, 2019 at 8:46
1 Answer
Reset to default 20I had not read that issue on GH, but if you scroll to the bottom you'll see there is now an onError
prop (as of v2.7.1) to provide a custom error handler.
<IntlProvider onError={myCustomErrorFunction} />
Provide your own error handler (without a console.error
) and the console error should go away.