Closed imcm7 closed 11 months ago
Can't work with mikroorm query result, I try all functions const user = this.userRepository.findOne(1);
instanceToPlain(user)
message":"Maximum call stack size exceeded","stack":"<pre><span class=\"stack internal\">at TransformOperationExecutor.getKeys (./node_modules/src/TransformOperationExecutor.ts:429:18
Not work with fields of type Collection
User {
id: 1,
roles: Collection<Role> { initialized: false, dirty: false },
}
and
User {
id: 1,
roles: Collection<Role> {
'0': Role {
active: true,
}
}
It is because user has role, and role has user?
But with instanceToPlain(x, { enableCircularCheck: true }),
Class constructor ObjectHydrator cannot be invoked without 'new'
Work with instanceToPlain(x, { enableCircularCheck: true, excludePrefixes: ['_', '__'] })
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
Can't use instanceToPlain with Nitro event. https://github.com/unjs/nitro
Expected behavior
Plain object
Actual behavior
TypeError: Cannot read properties of undefined (reading 'emit')
Example of nitro project
https://github.com/imcm7/nitro-db/blob/main/routes/api/index.ts