EntityMetadataNotFoundError: No metadata for "UserRepository" was found
See original GitHub issueI 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:
- Created a year ago
- Comments:8 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.tsfile and change the import in the user.module.ts file from[TypeOrmModule.forFeature([UserRepository, UserSettingsRepository])],to[TypeOrmModule.forFeature([UserEntity, UserSettingsEntity])],Fix it by using custom repository, let’s check it here: https://stackoverflow.com/questions/71557301/how-to-workraound-this-typeorm-error-entityrepository-is-deprecated-use-repo