question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RepositoryNotFoundError

See original GitHub issue

I have one entity(Player) and path in config is 100% good, because typeorm is creating table in db AND when im using this.connection.getRepository("Player") it finds it too(no error), but when im trying to import it using TypeOrmModule.forFeature([Player]) i got this error.

@edit i just find out that if in this.connection.getRepository im using Player class, not string it throws error too.

Code: https://github.com/Gecko222/game/tree/backend-refactor/src_server

PS. Stacktrace is showing wierd path:

Error
    at new RepositoryNotFoundError (E:\repos\game\src\error\RepositoryNotFoundError.ts:12:22)
    at EntityManager.getRepository (E:\repos\game\src\entity-manager\EntityManager.ts:769:19)
    at Connection.getRepository (E:\repos\game\src\connection\Connection.ts:306:29)
    at getRepository (E:\repos\game\node_modules\@nestjs\typeorm\typeorm.providers.js:8:22)
    at Object.useFactory [as metatype] (E:\repos\game\node_modules\@nestjs\typeorm\typeorm.providers.js:11:37)
    at Injector.<anonymous> (E:\repos\game\node_modules\@nestjs\core\injector\injector.js:84:59)

i dont have folder src.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
rizvanhaidercommented, Nov 26, 2019

I was facing the same issue but what fixed for me is I was missing the decorator @Entity() in my entity file.

4reactions
zaghircommented, Dec 28, 2020

Clean all files from /dist folder and start your application This is the config for posgresql/nestjs/typeorm which i use const connexionAtsDb: TypeOrmModuleOptions = { type: ‘postgres’, host: ‘localhost’, port: 5432, username: ‘postgres’, password: ‘admin’, database: ‘pass’,
schema: ‘warehouse’, entities: [__dirname + ‘/…/**/*.entity.{js,ts}’], synchronize: true, }; i hope to fix your problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

RepositoryNotFoundError : TypeORM - Stack Overflow
It looks like your entity import is not working. If you import via the wildcard: entities: [ __dirname + "/entity/*.js" ],`.
Read more >
typeorm/typeorm - Gitter
"RepositoryNotFoundError: No repository for "MyModelName" was found. Looks like this entity is not registered in current "default" connection?".
Read more >
External module "error/RepositoryNotFoundError" - typeorm
Globals · "error/RepositoryNotFoundError". External module "error/RepositoryNotFoundError". Index. Classes. RepositoryNotFoundError.
Read more >
reviewboard.scmtools.errors | Documentation | Review Board
exception RepositoryNotFoundError (msg=None, form_field_id=None)[source]¶. Bases: reviewboard.scmtools.errors.SCMError. An error indicating that a given ...
Read more >
Utilities - Hugging Face
RepositoryNotFoundError : 401 Client Error. (Request ID: PvMw_VjBMjVdMz53WKIzP) Repository Not Found for url: https://huggingface.co/api/models/% ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found