Open ColtraneNadler opened 3 years ago
@ColtraneNadler Have you ever managed to find a solution to this?
I'm also looking for a solution here. I'm using es target es2017
fwiw, this post solved it for me https://stackoverflow.com/a/68602295
use this
const posts = await Post.findAll({ where: {community_id: community}, include: [User], order: [['created_at', 'DESC']] })
return posts.get({ plain: true });
Issue
TypeError: Class constructor User cannot be invoked without 'new'
Versions
Issue type
Actual behavior
Expected behavior
It should return the rows with the included rows
Steps to reproduce
Query with an include
Related code
The issue when I use include. Im using routiing-controllers Snippet from the route handler that caused this particular error
Any ideas on how to fix? I'm following the documentation directly.