tada5hi/typeorm-extension

Bug:

Opened this issue · 0 comments

Versions

  • Node: 20
  • OS: Linux Ubuntu 24.04
  • typeorm@0.3.20
  • typeorm-extension@3.6.2

My package.json contains those scripts:
"seed:run": "cd ./dist && npx typeorm-extension seed:run -d ./src/app/data-sources/app-data-source.js", "seed:run:dev": "ts-node -r tsconfig-paths/register ./node_modules/typeorm-extension/bin/cli.cjs seed:run -d ./src/app/data-sources/app-data-source.ts", "migration:run": "cd ./dist && npx typeorm migration:run -d ./src/app/data-sources/app-data-source.js", "migration:run:dev": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js migration:run -d ./src/app/data-sources/app-data-source.ts",

My database options are:
{"type":"postgres","host":"localhost","port":5432,"database":"MASKED","schema":"MASKED","username":"MASKED","password":"MASKED","entities":["src/app/entities/**/*.{js,ts}"],"migrations":["src/app/migrations/**/*.{js,ts}"],"seeds":["src/app/seeds/**/*.{js,ts}"],"ssl":"enabled"}

Targets with ':dev' suffix are using ts-node. Those without any suffix uses node and transpiled code from dist folder.

"npm run migration:run" and "npm run migration:run:dev" work fine.

"npm run seed:run" works fine but not "npm run seed:run:dev".

I'm able to make it working but only if I provide absolute path for entities and seeds.

I tried many things like adding "dist/" or using "--root" option or specifying "NODE_PATH" without any success.