Skip to content
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

EntityMetadataNotFoundError: No metadata for "Role" was found. #878

Closed
its-monotype opened this issue Feb 20, 2023 · 12 comments
Closed

EntityMetadataNotFoundError: No metadata for "Role" was found. #878

its-monotype opened this issue Feb 20, 2023 · 12 comments

Comments

@its-monotype
Copy link
Contributor

╰─❯ npm run seed:run

> nestjs-boilerplate@0.0.1 seed:run
> ts-node -r tsconfig-paths/register ./src/database/seeds/run-seed.ts

[Nest] 2808  - 20/02/2023, 18:21:00     LOG [NestFactory] Starting Nest application...
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] SeedModule dependencies initialized +19ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] ConfigHostModule dependencies initialized +0ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] ConfigModule dependencies initialized +1ms
query: SELECT * FROM current_schema()
query: SELECT version();
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +269ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] RoleSeedModule dependencies initialized +0ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] StatusSeedModule dependencies initialized +1ms
[Nest] 2808  - 20/02/2023, 18:21:00     LOG [InstanceLoader] UserSeedModule dependencies initialized +0ms
C:\Users\itsmo\Desktop\my-app\node_modules\src\data-source\DataSource.ts:438
        if (!metadata) throw new EntityMetadataNotFoundError(target)
                             ^
EntityMetadataNotFoundError: No metadata for "Role" was found.
    at DataSource.getMetadata (C:\Users\itsmo\Desktop\my-app\node_modules\src\data-source\DataSource.ts:438:30)
    at Repository.get metadata [as metadata] (C:\Users\itsmo\Desktop\my-app\node_modules\src\repository\Repository.ts:53:40)
    at Repository.count (C:\Users\itsmo\Desktop\my-app\node_modules\src\repository\Repository.ts:467:40)
    at RoleSeedService.run (C:\Users\itsmo\Desktop\my-app\src\database\seeds\role\role-seed.service.ts:15:45)
    at runSeed (C:\Users\itsmo\Desktop\my-app\src\database\seeds\run-seed.ts:11:34)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    ```
@its-monotype
Copy link
Contributor Author

I just did steps in the readme for comfort development and facing this issue

@mustakim
Copy link

I am also facing this issue when run npm run seed:run

@mustakim
Copy link

@its-monotype , did you get any solution for the issue ?

@its-monotype
Copy link
Contributor Author

@its-monotype , did you get any solution for the issue ?

Sadly not, maybe @Shchepotin will help us, idk, I even though to migrate whole project to Prisma

@Shchepotin
Copy link
Collaborator

@mustakim @its-monotype

Which NodeJS version are you use?

Do you run project in Windows?

Do you run database in Docker?

@mustakim
Copy link

@Shchepotin,

My current node version is 16.15.1
Yes, I am running my project in windows.
No, I am not using docker.

@Shchepotin
Copy link
Collaborator

Shchepotin commented Feb 23, 2023

@mustakim please show output for npm run migration:run

@mustakim
Copy link

@Shchepotin, here is the output

image

@Shchepotin
Copy link
Collaborator

@mustakim do you make any changes in project?

@mustakim
Copy link

@Shchepotin, no changes without configuring the env. Mentioning that, I am using the main branch. even, though I didn't change the git repository yet.

@Shchepotin
Copy link
Collaborator

Shchepotin commented Feb 23, 2023

@mustakim could you please install typeorm 0.3.11:

  1. change version in package.json
  2. run npm i

I think it's because of these issues typeorm/typeorm#9772 and typeorm/typeorm#9766

Note: on Linux and MacOS I can't catch this problem and everything is working fine.

@mustakim
Copy link

@Shchepotin,

I will try this. I have switched to ubuntu on my other device and here it's working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants