New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TsMorphMetadataProvider embedded array objects are not discovered after upgrade from 5.3.1 to 5.5.0 #3690
Comments
Thanks for the repro and additional notes, wanna send a PR too? Should be just about stripping the |
Well. if you saying about just to strip it - that's fine, I can send a fix. Because, looking into full scope of this code, it is looking strange. First it was removed, but than it was added back if it is array.
I'll try, but no promises. |
Or you mean strip the line exactly for embeddable init? |
That code is doing a cleanup of possibly complex type expressions and tries to normalize it first. It strips the Maybe we don't need to strip it in the first place, but we would still need to conditionally add it as it might not be there at all, e.g. with the edit: or maybe some tests would fail if we revert it, feel free to try |
I think it's about this place: Scalar properties still need to be marked as arrays and that's where this information was needed. So we'd have to check for |
Well. Tests on the master branch I've pulled are not all passing on windows, because of basic differences in the path separator and other minor things. So, it will take a time. |
I believe it works fine via WLS, it did last time I tried (few months ago). |
Describe the bug
I'm getting the following error when initing MikroORM with TsMorph.
While it is showing in debug mode that all files and both
PTE
andBPE
entities was found, so entities is there.Having the structure something like this
In P.ts
In BPE.ts
Stack trace
To Reproduce
Try to generate a cache for example (without cache existing yet).
Or just call
MikroOrm.init
.Expected behavior
No error happens, and discovery phase is passed.
Additional context
There were no such issue in 5.3.1, it happened straight after version up.
So, I've debugged the problem and I believe it is this commit which caused this issue.
4a69871
As basically next inside the call
initEmbeddables
here https://github.com/mikro-orm/mikro-orm/blob/master/packages/core/src/metadata/MetadataDiscovery.ts#L741It is trying to find in metadata storage
PTE[]
string instead ofPTE
.PTE
string EXISTS in metadata storage though! I've checked it. So, it is both written in console and in debug I found it.Versions
The text was updated successfully, but these errors were encountered: