Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

ReactJS error after installing Content Manager

Vote:
 

Hi all,

I've recently installed the EPiServer.Labs.ContentManager NuGet package against our EPiServer solution. However, when I view the Content Manager page I am receiving the following JS errors:

Here is the line causing the error:

useEffect(() => {
onReload();
communicator.onSetContentLanguage(defaultLanguage.name); <------------------ Breaking here, defaultLanguage is undefined.
}, []);

I had a look at the CMS settings and seems there should be a default language:

I am wondering if anyone has any ideas how I would go about fixing this?

Note: EPiServer version installed is 11.15.1

Globalization setting in web.config is:

<globalization culture="en-AU" uiCulture="en-GB" requestEncoding="utf-8" responseEncoding="utf-8" resourceProviderFactoryType="EPiServer.Framework.Localization.LocalizationServiceResourceProviderFactory, EPiServer.Framework.AspNet" />
#225960
Edited, Jul 31, 2020 3:01
Vote:
 

Downgraded from 0.2.0 to 0.1.3 and the previous error has disappeared.

However, I am now receiving a new error which seems to be related - I am able to get onto the home screen of the Content Manager, but when I click on the Root tab I receive the following:

Uncaught TypeError: Cannot read property 'country' of undefined
at ro (language-selector.tsx:37)
at Dn (react-dom.production.min.js:154)
at pN (react-dom.production.min.js:259)
at fL (react-dom.production.min.js:230)
at wL (react-dom.production.min.js:229)
at sL (react-dom.production.min.js:223)
at aL (react-dom.production.min.js:214)
at uo (react-dom.production.min.js:279)
at react-dom.production.min.js:282
at lL (react-dom.production.min.js:224)
language-selector.tsx
line 33:

  return (
<ReactFlagsSelect
countries={countries}
customLabels={customLabels}
defaultCountry={defaultLanguage.country} <------ error is here
onSelect={onSelect}
/>
);

Hope that helps and someone can point me in the right direction :)

Cheers.

#226047
Aug 02, 2020 23:44
Vote:
 

After further investigation - I realised that the culture set in the web.config had to match the languages I had enabled. 

Therefore, my globalization tag was updated to:

<globalization culture="en-AU" uiCulture="en-GB" requestEncoding="utf-8" responseEncoding="utf-8" resourceProviderFactoryType="EPiServer.Framework.Localization.LocalizationServiceResourceProviderFactory, EPiServer.Framework.AspNet" />
#226048
Aug 03, 2020 1:30
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.