My NodeBB forum in production can not started due to this error:
2023-07-28T00:36:19.835Z [4567/2314] - error: TypeError: Cannot read properties of null (reading 'uid')
This error located in:
// src/meta/configs.js:177:39
plugins.hooks.register('core', {
hook: 'filter:settings.get',
method: async ({ plugin, values }) => {
if (plugin === 'core.api' && Array.isArray(values.tokens)) {
values.tokens = values.tokens.map((tokenObj) => {
tokenObj.uid = parseInt(tokenObj.uid, 10);
if (tokenObj.timestamp) {
tokenObj.timestampISO = new Date(parseInt(tokenObj.timestamp, 10)).toISOString();
}
return tokenObj;
});
}
return { plugin, values };
},
});
What is the possible cause of this error? I tried to use my dev mongodb and the error gone. I think there is some missing or broken data in my mongodb, but I dont know what it is. Is there anything I need to check?
Thanks in advance.