You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
First of all, awesome project, keep the great work! :)
I´m trying to use to use MikroORM in NestJS setup as a monorepo (so no glob file patterns for me), and trying to use the autoLoadEntities option to be able declare the entities in each module via forFeature.
The problem is that I would like to use EntitySchema declaration instead of using decorators, and the type in the forFeature method doesn't allow them.
I've checked that, if I ignore the typescript error, everything works fine, so my guess is that it's just an oversight of not also declaring EntitySchema as a valid type there.
Stack trace
Type 'EntitySchema<Account, undefined>' is not assignable to type 'EntityName<AnyEntity<any>>'.
To Reproduce
Steps to reproduce the behavior:
Instantiate MikroOrmModule with autoLoadEntities option enabled.
Declare in the forFeature method the EntitySchema you want to use.
Typescript explodes
Ignore TS error
Everything works as expected
Expected behavior forFeature method to allow for EntitySchema type.
Versions
Dependency
Version
node
16.15.1
typescript
4.7.4
mikro-orm
5.2.0
mongodb-driver
5.2.0
The text was updated successfully, but these errors were encountered:
Describe the bug
First of all, awesome project, keep the great work! :)
I´m trying to use to use MikroORM in NestJS setup as a monorepo (so no glob file patterns for me), and trying to use the
autoLoadEntities
option to be able declare the entities in each module viaforFeature
.The problem is that I would like to use EntitySchema declaration instead of using decorators, and the type in the
forFeature
method doesn't allow them.I've checked that, if I ignore the typescript error, everything works fine, so my guess is that it's just an oversight of not also declaring EntitySchema as a valid type there.
Stack trace
To Reproduce
Steps to reproduce the behavior:
autoLoadEntities
option enabled.forFeature
method the EntitySchema you want to use.Expected behavior
forFeature
method to allow for EntitySchema type.Versions
The text was updated successfully, but these errors were encountered: