Problem with hot reload and the typeorm
See original GitHub issueI’m submitting a…
[ ] Regression
[*] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Im using the hotreload configuration as you mentioned. But the problem is I’m using the database typeorm when I hit reload the I’m getting error AlreadyHasActiveConnectionError: Cannot create a new connection named "default", because connection with such name already exist and it now has an active connection session.
I tried with the
module.hot.dispose(async () => {
await getConnection().close();
await app.close();
});
Expected behavior
It should reload normally
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Nest version: 5.0.0
For Tooling issues:
- Node version: v10.1.0
- Platform: Linux
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to use TypeORM with hot-reloading without running into ...
When using TypeORM with Next.js, server-side hot-reloading is used by default and is convenient, except for one thing: Every time a hot ...
Read more >no metadata was found. - You.com | The AI Search Engine ...
For me, this was happening after the webpack hot-reload because when everything was reloaded, new entity models were generated. Although new entity models...
Read more >Hot reload | NestJS - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines ...
Read more >anyone else have problems with React's --template typescript ...
Hot reloading is... garbage. New files cause import errors. Doesn't detect random gibberish that should cause errors, but still detects other ...
Read more >Best practice for instantiating PrismaClient with Next.js
Problem. Lots of users have come across this warning while working with ... each time due to hot reloading that creates a connection...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@navigatetravel this is what I ended up doing: https://stackoverflow.com/a/54842659/4694994
Hello, I’m facing a similar problem. How did you fix that?