Why does the homepage show a "Cannot read properties of undefined (reading 'light')" error?
Summary
A "Cannot read properties of undefined (reading 'light')" error can occur when loading the Activate homepage.
In this scenario, an invalid value is configured in the Type parameter of an article within the Alert folder.
The issue is resolved by correcting the Type value to a supported, case-sensitive option.
Symptoms
When browsing to the Activate homepage, the page fails to load correctly.
Browser developer tools display an error similar to:
Cannot read properties of undefined (reading 'light')
The issue typically occurs on first load of the homepage.
Cause
Articles in the Alert folder use a Type parameter to control styling and visual presentation.
If the Type parameter contains an unsupported or incorrectly cased value:
The UI theme cannot resolve the required palette setting.
The homepage fails during rendering.
The allowed values are case sensitive and must be one of the following:
- error
- warning
- info
- success
Resolution
Correct the Type parameter value on the affected article.
Steps
- Open Activate Studio.
- Navigate to the Alert folder.
- Identify the article with the invalid Type parameter.
- Update the Type value to one of the supported case-sensitive options:
- error
- warning
- info
- success
- Save the change.
- Refresh the homepage.
Verification
After correcting the value:
The homepage loads without JavaScript errors.
No "Cannot read properties of undefined (reading 'light')" error appears in browser developer tools.
Prevention
When creating or editing Alert articles:
Ensure the Type parameter uses only supported, lower-case values.
Avoid custom or differently cased values, as they are not recognised by the UI theme.