Skip to content
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

Connection "default" was not found #68

Closed
longtruongagn003 opened this issue Aug 9, 2019 · 6 comments
Closed

Connection "default" was not found #68

longtruongagn003 opened this issue Aug 9, 2019 · 6 comments

Comments

@longtruongagn003
Copy link

ConnectionNotFoundError: Connection "default" was not found.
[0] at new ConnectionNotFoundError (..\src\error\ConnectionNotFoundError.ts:8:9)
[0] at ConnectionManager.get (..\src\connection\ConnectionManager.ts:40:19)
[0] at new LinqRepository (..\node_modules\typeorm-linq-repository\src\repository\LinqRepository.js:26:14)
[0] at new RoleService (..\src\modules\services\role.service.ts:28:35)
[0] at callback (..\node_modules@nestjs\core\injector\injector.js:74:41)
[0] at processTicksAndRejections (internal/process/task_queues.js:89:5)
[0] at Injector.resolveConstructorParams (..\node_modules@nestjs\core\injector\injector.js:113:24)
[0] at Injector.loadInstance (..\node_modules@nestjs\core\injector\injector.js:78:9)
[0] at Injector.loadProvider (..\node_modules@nestjs\core\injector\injector.js:35:9)

Please help me @IRCraziestTaxi .

Thanks.

@IRCraziestTaxi
Copy link
Owner

Hello again @longpro1601!

Unfortunately, without seeing how you are setting up your TypeORM connection, I can't really say what is wrong.

One of two things is happening: either your TypeORM connection isn't being opened properly before you attempt to perform a query or you must specify the name of the connection you are using if it is not the default (unnamed) one.

I assume you either cannot or do not wish to share the full code of your app, but is it possible for you to create a small repo showing your TypeORM setup, app startup, and a query as you are performing it? If I can see the code I can help you out more.

@freefred81
Copy link

Hi I have same Problem ... he give to me this Error:

No repository for "OpportunityRepository" was found. Looks like this entity is not registered in current "default" connection? +33ms
RepositoryNotFoundError: No repository for "OpportunityRepository" was found. Looks like this entity is not registered in current "default" connection?
at new RepositoryNotFoundError (/Users/fscamuzzi/Documents/Temp/nestproject/src/error/RepositoryNotFoundError.ts:10:9)
at EntityManager.getRepository (/Users/fscamuzzi/Documents/Temp/nestproject/src/entity-manager/EntityManager.ts:1008:19)
at Connection.getRepository (/Users/fscamuzzi/Documents/Temp/nestproject/src/connection/Connection.ts:342:29)
at getRepository (/Users/fscamuzzi/Documents/Temp/nestproject/node_modules/@nestjs/typeorm/dist/typeorm.providers.js:13:26)
at InstanceWrapper.useFactory [as metatype] (/Users/fscamuzzi/Documents/Temp/nestproject/node_modules/@nestjs/typeorm/dist/typeorm.providers.js:22:20)
at Injector.instantiateClass (/Users/fscamuzzi/Documents/Temp/nestproject/node_modules/@nestjs/core/injector/injector.js:279:55)
at callback (/Users/fscamuzzi/Documents/Temp/nestproject/node_modules/@nestjs/core/injector/injector.js:74:41)
at process._tickCallback (internal/process/next_tick.js:68:7

BUT IF I REMOVE TYPE-ORM-LINQ it works ..

my repo:

https://github.com/freefred81/nestproject

@IRCraziestTaxi
Copy link
Owner

Sorry I have been off the radar. Work has been bonkers lately.

@freefred81 I am unfamiliar with nest, but I will take a look at the repo and see if I can spot the problem.

@longpro1601 Your issue appears to be a different one than @freefred81's. Could you possibly provide a repo demonstrating the issue so I can take a look at it?

@IRCraziestTaxi
Copy link
Owner

Actually @freefred81, let's continue the discussion for your issue at the issue you opened.

@IRCraziestTaxi
Copy link
Owner

@longpro1601 For your reference, take a look at @freefred81's repository because they said they got it running (minus the issue with .where(...).isFalse() that we are trying to work out). If you continue to experience the issue, please set up a small repro that I can take a look at.

@IRCraziestTaxi
Copy link
Owner

Since this has been inactive for almost a month, I'm going to go ahead and close it. If you continue to experience the problem, please create a repro I can clone and look at and reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants