ABP Framework version: 6.0.1
Lepton version: 6.0.1
The project was created using Abp Suite and ran, and this happened:
ERROR TypeError: Cannot read properties of undefined (reading 'toLowerCase')
in file: volo-abp.ng.theme.lepton.mjs:1266:42
Going to that line in the file this is what I found:
const LEPTON_THEME_FEATURES = new InjectionToken('LEPTON_THEME_FEATURES', {
providedIn: 'root',
factory: () => {
const configState = inject(ConfigStateService);
const featureKey = 'LeptonManagement.Enable';
const mapFn = features => ({
// The prolem is here: Uncaught ReferenceError: features is not defined
enable: features[featureKey].toLowerCase() !== 'false',
});
return featuresFactory(configState, [featureKey], mapFn);
},
});
Kindly how do I solve this problem?
I could see only place it broken in your code is this features[featureKey].toLowerCase()
Try add safe check.
const mapFn = features => {
let enable = false;
if (features[featureKey]) {
enable = features[featureKey].toLowerCase() !== 'false',
}
return {
enable
}
};