You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
how to print real location in code, when the typeorm throw error #11765
hm, I think such errors should print the whole stack trace to the relevant services in NestJS. Can you provide more info on how your app works and where do you call the insert method and how you inject the repository? and what version of TypeORM? can you provide a minimal reproducible example of the problem?
The quality of async stacktraces in Node depends on the Node version as well as how code is transpiled.
So this might be a problem with the driver rather than TypeORM itself.
TypeORM is mostly written with modern async/await syntax and is transpiled to ES2021 (which retains async/await) so should produce good async stacktraces.
However if an error occurs in driver code, we're at the mercy of how that driver is implemented.
The mysql2 driver appears to target ES2016, which will rewrite async/await as callbacks - with a corresponding reduction in stacktrace usefulness.
Activity
OSA413 commentedon Nov 13, 2025
hm, I think such errors should print the whole stack trace to the relevant services in NestJS. Can you provide more info on how your app works and where do you call the insert method and how you inject the repository? and what version of TypeORM? can you provide a minimal reproducible example of the problem?
sgarner commentedon Nov 13, 2025
The quality of async stacktraces in Node depends on the Node version as well as how code is transpiled.
So this might be a problem with the driver rather than TypeORM itself.
TypeORM is mostly written with modern async/await syntax and is transpiled to ES2021 (which retains async/await) so should produce good async stacktraces.
However if an error occurs in driver code, we're at the mercy of how that driver is implemented.
The
mysql2driver appears to target ES2016, which will rewrite async/await as callbacks - with a corresponding reduction in stacktrace usefulness.dengshenkk commentedon Nov 14, 2025
I found same case, it's for long time ago. It still not be resolve, is there is any plan to implement this feature?
ref links
https://stackoverflow.com/questions/62327213/typeorm-stack-trace-not-showing-origin-of-error-in-my-code?rq=4
sidorares/node-mysql2#1067
#11271
pkuczynski commentedon Nov 20, 2025
#11273 made an attempt to fix this issue...