mikro-orm: Type instantiation is excessively deep and possibly infinite.ts for any query with $or and $and
Describe the bug
If i have any query with $and or $or condition like:
const reports = await em.find(
Report,
{
$or: [{ title: 'asd' }, { name: 'asd' }],
},
{
populate: ['organization']
}
);
I see typescript error
Type instantiation is excessively deep and possibly infinite.ts(2589)
Versions
3.0.0-alpha.29
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (12 by maintainers)
Commits related to this issue
- docs: add note about possible TS inference problems with FilterQuery Closes #208 — committed to mikro-orm/mikro-orm by B4nan 5 years ago
But again, you are using the compiled code from ORM (plus the typings), the TS source code is not even part of the npm package.
No, but doesn’t it break when you specify typescript 3.5.3 in package.json (which is required for Angular) and MikroORM uses 3.7? It’s all in the same project.
I don’t think there needs to be any breaking change even if we use internally TS 3.7, as the code you will be using will be the transpiled JS and not the source code, so unless we use some TS 3.7 feature in typings, it should be fine.
I am still waiting for example of the failure, as for me it is working ok when I provide the type parameter explicitly.
I am not fine with having a dependency on that version as it breaks support with Angular (3.5.3) then. Would rather not see it break support for such a small error (assumed functionality will not break, only types not shown properly). Maybe have a message saying you need typescript 3.7 to support this func?