-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question: getting error "Cannot get connection "default" from connection manager." #39
Comments
+1 |
1 similar comment
+1 |
Same Issue, the following message appears:
even when the code goes as follows:
|
@MickSawy3r I assume you figured it out but for others coming here: Check this issue #487 (typeorm/typeorm#487) in index.ts add typeorm.useContainer(typedi.Container); I had the same error and it solved the problem. |
Cannot reproduce. As the docs and @ethernal says: you need to configure TypeORM to use the TypeDI container before you can use the decorators. import { createConnection, useContainer } from 'typeorm';
import { Container } from 'typedi';
/** Tell TypeORM to use the TypeDI container to resolve it's dependencies. */
useContainer(Container);
/** Create a connection and start using TypeORM. */
createConnection({
/* <connection options> */
}).catch(error => {
console.error(`Couldn't connect to the database!`);
console.error(error);
}); |
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. |
TypeORM version:
0.2.18
Extension version:
0.2.3
await createConnection();
I'm using the default
.env
connection config.The text was updated successfully, but these errors were encountered: