I have somehow encountered a weird error, am joining alot of tables, a subset of the code as below:
...
.leftJoinAndSelect('req.steps', 'step')
.leftJoinAndSelect('step.user', 'appUser')
.leftJoinAndSelect('appUser.user', 'appStaff')
...
and the error I get is:
Unknown column 'appuser.user.id' in 'on clause'
and the table clearly has a userId column, so the strange part is all the other columns are trasnlated correctly, a subset of the generated query as below:
LEFT JOIN `step` `step` ON `step`.`requestId`=`req`.`id` LEFT JOIN `step_user` `appUser` ON `appUser`.`id`=`step`.`userId` LEFT JOIN `user` `appStaff` ON `appStaff`.`id`=appUser.user.id AND (`appStaff`.`deleted` IS NULL)
And a subsection of the entity:
@ManyToOne(() => User, user => user.steps)
user: User;
Basically, they are all defined the same but end up with different output, can someone explain to me what i did wrong here or if this is a known issue.