pinia-orm
pinia-orm copied to clipboard
Decorators with typescript - Value of type 'typeof HasMany' is not callable. Did you mean to include 'new'?
Hello,
i am trying to use the decorators for relationships in a typescript vue project. But i am getting an error:
Value of type 'typeof HasMany' is not callable. Did you mean to include 'new'?
@HasMany(() => MoodPercentage, 'moodId') declare percentages: MoodPercentage[]
Using the static field variant seems to work:
static fields () {
return {
percentages: this.hasMany(MoodPercentage, 'moodId'),
}
}
The typescript compiler options are:
"useDefineForClassFields": true,
"moduleResolution": "bundler",
"experimentalDecorators": true
Maybe someone has a suggestion for me
Regards nowrap
Please provide a reproduction. 🙏 This are not enough information to see what the problem is.
Sure, I'd love to, but it's more likely to be next week
I think this is resolved. Please reopen it if not. Thanks ❤️