-
Notifications
You must be signed in to change notification settings - Fork 10
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
No repository for "XXXRepository" was found. Looks like this entity is not registered in current "default" connection? #70
Comments
I have change a little bit my code ..and now it works .. BUT only the GetAll() ... if i try a where clause it stay stucked .. i have updated the repo ... thnx! |
Hi .. any news? |
Sorry I have been off the radar. Work has been bonkers lately. I will take a look at the repo and see if I can spot the problem. |
@freefred81 Your usage of let query = await this.opportunityRepository.getAll()
.where(xx => xx.isdeleted)
.isFalse(); looks correct. Could you clarify what you mean by
? Do you get an error or does the async never return? Hopefully you can get that info to me quicker than it would take me to get a database set up and all that so I can try it myself. |
Hi ...!!! ... First of all REALLY REALLY thnx for your time and support .... !! .. i know you maybe work hard .. so really thnx for your time !! ... I'vee update my repo with a new folder (database) inside there's a scripts folder where you can find 2 scripts (.sql) to create the Table Opportunity e insert one record inside it ... So you can debug it and you'll se what happen .... if you try to call the GET method of Opportunity route with : it hit the method in the controller
It calls the getAll() method in the opportunityService:
and it call the getAll() method from the OpportunityRepository (which extends your LinqRepository)
Here everything works as expected ... but if you try to call other API in of the OpportunityController with
it call the method of controller
it calls the findNotDeleted(..) method in the opportunityService
BUT here when it reach the IT NEVER GOES TO THE NEXT BREAK POINT
AND NO RESULT IS RETURNED ... |
How are you debugging? Can you share your |
Really sorry for delay ... try to install nodemon globally with
then inside the project (once you've
Vs code will start in debug mode (and will hitting yours break point) Let me know if it works or not! |
I don't know what's happening here. :/ The debug console spat out some SQL junk then the debugger detached. Now I cannot debug because I get When I just run I also had to fix several typescript errors to get the TS to compile before I could run the app at all. I don't see any commits to pull or another branch to check out... are you sure you have all your changes checked in? |
mmm looks strange .. i don'n have any error.. try to disable the tslint vscode extensions (it's too much strict).
|
After restarting so I could attempt debugging again, I took exact notes of my actions and the results I received.
(Note the original
With the following options available:
HOWEVER, debugger starts anyway (again, strange, but doesn't appear to hurt anything)
So the I'll keep looking when I have time, but without being able to run the app, there's not much I can do. |
Ah, ok... I had a suspicion of something and confirmed it. The reason the debugger detaches is because the app crashes with the original At the same time the debugger stops, the Terminal displays the error.
|
Ok, I can't believe I missed this before, but here is what is happening. I didn't realize the error said that no repository was found for Since So, sure enough, in
But since
So I made that change and then could run and debug the app. However, what I find now is that I'm not sure why your My first suggestion was going to replace the following in providers: [OpportunityService], with: providers: [
{
provide: OpportunityService,
useFactory: () => new OpportunityService(new OpportunityRepository())
}
] just to see if that would force the correct repository to be used (although it should not be necessary), but oddly enough, that throws the following error:
Where now the actual imports: [TypeOrmModule.forFeature([Opportunity])], I am truly, truly perplexed at what the hell Nest is doing. |
Ok, after some digging, I found this @nestjs/typeorm issue. Go through that; in particular, this comment looks promising. I won't have time to look into this further for a while, but maybe that will get you closer to the solution. At any rate, I believe it is clear at this point that this is not a typeorm-linq-repository issue but a Nest issue, so I'm going to close this for now, but feel free to continue the discussion. |
Hi !! ... IT WORKS!!!!! .... really really thnx for your time and patiente ... it works as expected!! .... you' re the number ONE!!! |
That's great! I'm glad it's resolved! :) |
Hi ... I'm trying to use TypeORM-Linq with my Nest.js project.
But it give to me this error on startup:
If i remove TypeOrm-linq everything works as expected ...
Can you help me? your prject for a guy like me who came from a strong C# background is a Joy!!! ...
my repo :
https://github.com/freefred81/nestproject
The text was updated successfully, but these errors were encountered: