Open Leonelmarianog opened 1 year ago
Created a minimal reproduction repository for this: https://github.com/Leonelmarianog/typeorm-transactional-test
I have the same error, though it only occurs when using the latest version (0.4.1). If I downgrade to 0.3.0 everything works flawlessly.
For me it works when I wrap the call to initializeTransactionalContext
into a conditional if statement, that checks if there is already a context initialized:
const transactionalContext = getTransactionalContext();
if (!transactionalContext) {
initializeTransactionalContext();
}
getTransactionalContext
is imported from typeorm-transactional/dist/common
Hello,
Using this library with the following NestJS configuration (Webpack's Hot Module Replacement) makes the following error appear when reloading the app.
This doesn't break the app but is quite annoying in development.
I tried to fix it by following this question.
But it makes it worse.
What can I do?.
Thanks!.