0

I know, some other questions already on this, but none of them discuss about production env, only testing component, my question is about production environment.

So, after upgrade react-intl i got this error:

Uncaught Error: [React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.

idk why, i try find solution about this, even on formatjs github issue still not fix this error

but if i don't upgrade this, react-int old version doesn't support with nodejs 16 or latest react@17.x, i need this latest react btw to support other packages too.

So my specs:

Node version: 16.14 (LTS)
NPM Version: 8.3.x

Packages:

react: 17.x
@mui/core: 5.x <<< i need this with latest react because for minimum requirements
react-intl: 5.x <<< so, i should upgrade this package too

i already set IntlProvider

App.js

<IntlProvider locale={props.userLang || language} messages={messages}>
...
</IntlProvider>

EDIT :

so react-intl won't load if your components got errors, because it's wrapper component. The solution is simple, fix your errors on your components then react-intl will be execute properly

0 Answers0