Replies: 5 comments 27 replies
-
We are having the same issue after updating to v5.8, did not have time to look into it yet, but the error is also "RangeError: Maximum call stack size exceeded", rolling back for now |
Beta Was this translation helpful? Give feedback.
-
Does it happen locally? If so, please try to add some The first error is some cycle, for those, I would definitely need to see a complete reproduction. The other one seems easier to resolve, but again, without a repro, it would be doing changes in the blind. Also seeing you have some collections with |
Beta Was this translation helpful? Give feedback.
-
Im currently testing our use case locally what i got so far (let me know if is should create my own issue for this):
I noticed the query getting slower and slower, the more organizationFeatureFlagConnections are connected to the entity and at some point i just geht the "maximum call stack" error. When i change the LoadStragegy to select-in, it worked again. |
Beta Was this translation helpful? Give feedback.
-
I just pushed this commit, which might help with both problems. The dev version will be out in ~15 minutes, so please try it once it's there and let me know. |
Beta Was this translation helpful? Give feedback.
-
This issue is fixed on the latest release (5.8.1). Tested with reverted changes to JOINED strat. |
Beta Was this translation helpful? Give feedback.
-
I've tried creating a reproducible repo, but I can't replicate the error 100% because I don't know why it's happening. The application suddenly started throwing out this error with no entity schema changes today.
Version 5.8.0 (core, cli, reflection, MySQL) along with mikro-orm/nestjs 5.2.1
Whenever some relations are loaded, RangeError: Maximum call stack size exceeded is thrown
The error stack is the following:
/usr/src/app/node_modules/@mikro-orm/knex/AbstractSqlDriver.js:605:45
at Array.forEach ()
at /usr/src/app/node_modules/@mikro-orm/knex/AbstractSqlDriver.js:603:29
at Array.forEach ()
at MySqlDriver.mergeJoinedResult (/usr/src/app/node_modules/@mikro-orm/knex/AbstractSqlDriver.js:600:20)
at MySqlDriver.find (/usr/src/app/node_modules/@mikro-orm/knex/AbstractSqlDriver.js:54:25)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at MySqlDriver.findOne (/usr/src/app/node_modules/@mikro-orm/knex/AbstractSqlDriver.js:70:21)
at SqlEntityManager.findOne (/usr/src/app/node_modules/@mikro-orm/core/EntityManager.js:364:22)
at IntegrationsService.getById (/usr/src/app/src/modules/integrations/integrations.service.ts:23:16)
Following is an example of entity schemas throwing this error
I understand it's hard to debug without a reproducible repo, but if anyone can point me in any direction, I would greatly appreciate it. I don't understand why this error is being thrown or if there is a bug on mikro-orm package. One thing I noticed is when the strategy is changed to SELECT_IN, the error resolves itself but some relations throw a different error:
TypeError: Cannot read properties of undefined (reading '__helper')
at helper (/usr/src/app/node_modules/@mikro-orm/core/entity/wrap.js:21:19)
at /usr/src/app/node_modules/@mikro-orm/core/entity/EntityLoader.js:189:47
at Array.forEach ()
at EntityLoader.initializeOneToMany (/usr/src/app/node_modules/@mikro-orm/core/entity/EntityLoader.js:187:22)
at EntityLoader.initializeCollections (/usr/src/app/node_modules/@mikro-orm/core/entity/EntityLoader.js:166:18)
at EntityLoader.populateMany (/usr/src/app/node_modules/@mikro-orm/core/entity/EntityLoader.js:161:14)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at EntityLoader.populateField (/usr/src/app/node_modules/@mikro-orm/core/entity/EntityLoader.js:247:27)
at EntityLoader.populate (/usr/src/app/node_modules/@mikro-orm/core/entity/EntityLoader.js:47:13)
at SqlEntityManager.lockAndPopulate (/usr/src/app/node_modules/@mikro-orm/core/EntityManager.js:1279:9)
Beta Was this translation helpful? Give feedback.
All reactions