'findOne query does not return included data sometimes

I am using sequelize findOne and my query sometimes returns the included data in commonInclude() and sometimes it does not.

Query:

Model.findOne({
   where: { id },
   order: [[‘name’, ‘ASC’]],
   include: commonInclude(),
})


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source