Enity metadata not found on running seed
See original GitHub issueHey all,
I’m attempting to seed some test data but whenever I try running the function it returns
TypeORMError: Entity metadata for FacilityPrice#facility was not found. the issue is the connection is working fin when I attempt to run any request (query builder). Moreover, I tried deleting the FacilityPrice#facility and it ends up returning another error for another reference somewhere, this process continues until I’ve deleted everything but the user table (the table I am attempting to seed) only then does it work.
Below is the config file setup. Any assistance is much appreciated.
ormconfig.ts (typescript file)
module.exports = {
type: "postgres",
host: "localhost",
port: 5432,
username: "---",
password: "---",
database: "---",
migrationsRun: true,
synchronize: false,
logging: true,
logger: "advanced-console",
migrationsTableName: "migrations",
migrations: ["migrations/*.ts"],
cli: {
migrationsDir: "migrations",
},
namingStrategy: new CustomNamingStrategy(),
// seeds: [__dirname + "seeds/seeds/**/*{.ts,.js}"],
// factories: [__dirname + "seeds/factories/**/*{.ts,.js}"],
// entities: [__dirname + "apps/entities/**/*.entity{.ts,.js}"],
seeds: ["seeds/seeds/**/*{.ts,.js}"],
factories: ["seeds/factories/**/*{.ts,.js}"],
entities: ["apps/entities/**/*.entity{.ts,.js}"],
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
No metadata for "entity" was found when seeding
The problem was that I am working in development environment. The entities were found in the dist directory instead of factories and seeds...
Read more >typeormerror: entity metadata for was not found. - You.com
I'm attempting to seed some test data but whenever I try running the function it returns TypeORMError: Entity metadata for FacilityPrice#facility was not...
Read more >Metadata Providers | MikroORM
As part of entity discovery process, MikroORM uses so called MetadataProvider to get necessary type information about our entities' properties.
Read more >IConventionModel Interface (Microsoft.EntityFrameworkCore ...
Metadata about the shape of entities, the relationships between them, ... it to be run explicitly in cases where the automatic execution is...
Read more >typeorm/typeorm - Gitter
I feel like I'm close but I get the error: TypeORM connection error: Error: Entity metadata for Toy#creator was not found. Check if...
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

Ok, i will check this evening. I’m going to work again on this repo this week
I found that the error in your example repo is just naming. One of your entities does not complain required
regexp, and typeorm could not find that as entity.Pls check if that is your problem, make sure that every file is well defined.
P.D.: I will close this, it is more related to typeorm (like this one)