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.

Enity metadata not found on running seed

See original GitHub issue

Hey 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:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jorgebodegacommented, Nov 15, 2021

Ok, i will check this evening. I’m going to work again on this repo this week

0reactions
jorgebodegacommented, Nov 16, 2021

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)

Read more comments on GitHub >

github_iconTop 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 >

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