Hello @Enki thanks for your answer,
Here is the configuration of the previous chart that has the same error, it may be better to debug with this one because it’s a simple query, that use no relations and no smart fields :
I think the cause is related to the fact that on the User (custom name : “Client”) model we use a beforeFind hook to add some included models to the base query, because on this collection we have many smart fields, and they use data from 8 related tables, so it’s the best way i found to have this data available for my smart fields and avoid doing tons of requests for each user displayed in the list.
Here is what we do in the beforeFind hook concerning the “company” table :
if (!options.include.find(m => m.as === 'company')) {
options.include.push({
model: sequelize.models.Company,
as: 'company',
attributes: null,
})
}
This successfully gives me the data of this related table directly available in the get function of my smart fields.
I’m afraid the problem is related to this, do you know how i can fix this ?
If you know a better way to do this “pre-loading” it would be fine too.
