Skip to content
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

populate not work #2527

Closed
n4an opened this issue Dec 13, 2021 · 3 comments
Closed

populate not work #2527

n4an opened this issue Dec 13, 2021 · 3 comments

Comments

@n4an
Copy link

n4an commented Dec 13, 2021


node v14.17.6 Ubuntu 20

"@mikro-orm/cli": "^4.5.9",
"@mikro-orm/core": "^4.5.9",
"@mikro-orm/mysql": "^4.5.9",
"@mikro-orm/nestjs": "^4.3.1",
"@mikro-orm/reflection": "^4.5.9",
"@nestjs/common": "^8.2.3",

populate with strategy: LoadStrategy.JOINED not work

PS: with Load Strategy JOINED work in version 5+

@B4nan
Copy link
Member

B4nan commented Dec 13, 2021

full stack trace?

@B4nan
Copy link
Member

B4nan commented Dec 13, 2021

Oh, so you are trying partial loading with joined strategy - that is not implemented in v4, but it is working with v5. You will need to upgrade if you want that. v5 is almost complete, definitely safe choice if you are starting new project or just trying out things. Also both populate and fields are strictly type checked in v5, so you would not fall into those issues with typos.

And I was asking about those stack traces:

I get error 'TypeError: Cannot read property 'orderBy' of undefined' if indicated wrong

Get error 'TypeError: Cannot read property 'reference' of undefined' if miss one letter

@B4nan
Copy link
Member

B4nan commented Dec 14, 2021

I am keeeping this open only for possible added error handling/validation. If you are not going to give me the reproductions for those errors I asked for, we can close this 🤷

Tried to intentionally make typos in both populate hint and fields, but they both don't produce those error you were talking about, they fail with either populate validation or with a wrong fields in SQL query, both is fine to me. Maybe those cases are already handled in v5 correctly.

Will be happy to reopen if you can show me how to get to those ugly and unclear errors.

@B4nan B4nan closed this as completed Dec 14, 2021
@n4an n4an changed the title populate not work + very ugly and unclear error messages populate not work Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants