typeorm-seeding
typeorm-seeding copied to clipboard
Could not load seeders!
Sorry, I cannot work just with an image without any context.
Please, try to create a reproducible example in a repo, or at least, a decent amount of code.
I ran into the same issue, I debugged it: the problem is that the "run" method receives the following array as paths: [ 'seed', './seed/0_clear.ts', './seed/1_create_users.ts', ... ]
@jagoanmamah did you have a seed folder too? Based on the image your case can be a different one.
The root cause is that the seed command is prepended to the paths array (maybe the "commander" package is misused) and if you store the seeds under a folder named "seed" you can see this error message because we try to load the module from that folder.
I figured out two workarounds, both of them are working independently:
- Remove the "seed" command when calling the CLI (for me it's something like that:
ts-node -r tsconfig-paths/register ./node_modules/@jorgebodega/typeorm-seeding/dist/cli.js -d ./data-source.ts ./seed/*.ts
) - Rename the "seed" folder to something else, for example "seeders": (for me it's something like that:
ts-node -r tsconfig-paths/register ./node_modules/@jorgebodega/typeorm-seeding/dist/cli.js seed -d ./data-source.ts ./seeders/*.ts
)
I don't have time to fix this issue and send a PR but I hope these informations are going to help you!