Skip to content

Bug: factory not found on runtime #1019

Description

@simon-tannai

Versions

  • Node: 20
  • OS: Docker Alpine

Reproduction

Additional Details Commands:
{
    "cli": "node ./dist/apps/cli/main",
    "cli:dev": "ts-node ./apps/cli/src/main"
}

Datasource:

private readonly options: DataSourceOptions & SeederOptions = {
    ...databaseConfig,
    factories: [join(__dirname, '..', '..', '..', '..', 'apps', 'my-app', 'src', '**', '*.factory{.ts,.js}')],
    seeds: [MainSeeder],
}

Steps to reproduce

I'm using nest-commander to create a CLI application to seed a database into a production-like environment.

In dev' env', the seeding is working well. But in production-like env' (after TS build), it's not working.

It looks typeorm-extension is not working without ts-node ?

What is Expected?

Running seeds into production-like environment without ts-node.

What is actually happening?

Error: No seeder factory is registered for the entity: MyEntity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions