EntityMetadataNotFoundError: No metadata for "UserRepository" was found

See original GitHub issue

I got this error while registering new user & running e2e testing: [Nest] 11896 - 09/10/2022, 3:27:48 PM ERROR [ExceptionsHandler] No metadata for "UserRepository" was found. EntityMetadataNotFoundError: No metadata for "UserRepository" was found.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
joshsisleycommented, Sep 12, 2022

If you are having this issue still there are a couple of things you need to do in order to fix it.

Inside of the user.service.ts you need to replace private userRepository: UserRepository, with @InjectRepository(UserEntity) private userRepository: Repository<UserEntity>,

Then after switching that out, you can go ahead and get rid of the user.repository.ts file and change the import in the user.module.ts file from [TypeOrmModule.forFeature([UserRepository, UserSettingsRepository])], to [TypeOrmModule.forFeature([UserEntity, UserSettingsEntity])],

2reactions
Root-Controlcommented, Sep 11, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

EntityMetadataNotFound: No metadata for "User" was found.
Hello, I'm trying to setup a new project using the latest release and the ormconfig.yml options. I'm following the documentation and ...
Read more >
No metadata for "Repository" was found - Stack Overflow
EntityMetadataNotFoundError : No metadata for "OrganizationsRepository" was found. Here is what my code looks like
Read more >
typeorm entitymetadatanotfounderror: no metadata for was ...
Solution for EntityMetadataNotFound: No metadata for was found The entity is a Typescript class that maps to a table in the database. If...
Read more >
TypeORM - No metadata for "User" was found. - Reddit
TypeORM: EntityMetadataNotFound: No metadata for "User" was found. Hey all! ... @EntityRepository(User) export class UserRepository extends ...
Read more >
typeorm/typeorm - Gitter
Inserting a new user into the database... { EntityMetadataNotFound: No metadata for "User" was found. at new EntityMetadataNotFoundError ...
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