In my case it turns out that the Book I imported was the model and not the entity. In this case of course TypeORM can't really figure out what it should do.
It was fairly difficult to debug this oversight which seems like it has an obvious solution in a type checked environment like ours:
If you pass something to entities: that does not work, print out a message (or a warning).
Is there an existing issue for this?
Current behavior
Hi,
I found myself in a bit of a hole with the TypeORM integration. I followed the Trilon tutorial and cobbled together this:
The tutorial is this one (there the object is called
Country
) and has the exact same problem: https://github.com/TrilonIO/nest-data-source-agnostic/tree/main/src/countriesIn my case it turns out that the
Book
I imported was the model and not the entity. In this case of course TypeORM can't really figure out what it should do.It was fairly difficult to debug this oversight which seems like it has an obvious solution in a type checked environment like ours:
If you pass something to
entities:
that does not work, print out a message (or a warning).Minimum reproduction code
https://github.com/alper/nestjs-sample/commit/2262a918a03492a91b6960f185baecc0096c2fcc
Steps to reproduce
No response
Expected behavior
I expect there to be an error message if you pass something that obviously does not work into the system.
Package version
10.0.1
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
Other
No response