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
In my codebase I have the following:
An entity model that has a type circularity (see below)
Custom entity repositories
Each entity is annotated with [EntityRepositoryType]: ...
When I try to compile I get the following compile time errors:
Type instantiation is excessively deep and possibly infinite. ts(2589)
Expression produces a union type that is too complex to represent. ts(2590)
'methodName' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. ts(7023)
I haven't been able to craft a repro that produces the first two errors, but can easily produce a repro that produces the third error.
Stack trace
N/A
To Reproduce
Steps to reproduce the behavior:
Attempt to compile the code in main.ts, below.
Notice the error on ParticipantRepository's get method.
Per #2652 (comment), modifying ExpandObject<T> to filter out functions (and symbols like EntityRepositoryType) seems to address all three errors for me.
Versions
Dependency
Version
node
16.6.2
typescript
4.5.4
mikro-orm
5.0.1-dev.23
your-driver
sqlite
The text was updated successfully, but these errors were encountered:
Describe the bug
In my codebase I have the following:
[EntityRepositoryType]: ...
When I try to compile I get the following compile time errors:
I haven't been able to craft a repro that produces the first two errors, but can easily produce a repro that produces the third error.
Stack trace
N/A
To Reproduce
Steps to reproduce the behavior:
main.ts
, below.ParticipantRepository
'sget
method.main.ts
Expected behavior
No compiler errors.
Additional context
This was originally reported here: #2652 (comment).
Per #2652 (comment), modifying
ExpandObject<T>
to filter out functions (and symbols likeEntityRepositoryType
) seems to address all three errors for me.Versions
The text was updated successfully, but these errors were encountered: