Error: RepositoryNotFoundError: No repository for [Enitity] was found. Looks like this entity is not registered in current "default" connection?
Problem
Issue type: [x] question [x] bug report [ ] feature request [ ] documentation issue Database system/driver: [ ] `cordova` [ ] `mongodb` [ ] `mssql` [x] `mysql` / `mariadb` [ ] `oracle` [ ] `postgres` [ ] `sqlite` [ ] `sqljs` [ ] `react-native` [ ] `expo` TypeORM version: [ ] `latest` [ ] `@next` [x] `0.2.8` (or put your version here) Steps to reproduce or a small repository showing the problem: 1. Create my entity: import {Entity, PrimaryColumn, Column, BaseEntity} from "typeorm"; [code block] 2. Create my method: [code block] 3. Test with: `mocha --require ts-node/register './*/.test.ts' --recursive` Then, it throws that error. But also, it occurs not every time. Sometimes, the code can run well three or four times and then throw that bug next time. I don't really know what the cause is as I took that code from another of my projects in which it was and is working just fine.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Error: RepositoryNotFoundError: No repository for [Enitity] was found. Looks like this entity is not registered in current "default" connection?
https://typeorm.io/#/connection-options/common-connection-options [code block]
Trust Score
9 verifications
- 1
https://typeorm.io/#/connection-options/common-connection-options
[code block]
Validation
Resolved in typeorm/typeorm GitHub issue #3017. Community reactions: 92 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep