Open timurkhakhalev opened 8 months ago
tsx
is not supported yet.
Please try passing --preserveFilePaths
as additional cli option.
at the moment typeorm-extension
assumes that you execute the cli on build files.
https://github.com/tada5hi/typeorm-extension/blob/02b07c3744182d7327eae9f2e4c3fee9b50c6b3f/src/utils/code-transformation/module.ts#L4
Maybe you can create a pr on how to detect tsx environment :relaxed: :v:
I am also getting this error and --preserveFilePaths
unfortunately did not resolve.
can you provide a reproduction repo ?
at the moment
typeorm-extension
assumes that you execute the cli on build files.
Hitting the same error in a NestJs project after switching to SWC, but that comment pointed me in the right direction. Adjusting the data source path pointing to /dist
directory did the job in my case:
npx ts-node node_modules/typeorm-extension/bin/cli.cjs seed:run -d dist/seed/config/typeorm.seed.config.js
Versions
Reproduction
Can't load data-source when in tsconfig.json there are other options than "outDir": "dist", "rootDir": "./src", or when there are no dist folder in project
I have dive into your source code and noticed that in the path variable here https://github.com/tada5hi/typeorm-extension/blob/048408c7942a90982eef491860fc390500294192/src/data-source/find/module.ts#L88 there are : ``` [ '/home/timur/dev/project', '/home/timur/dev/project/dist/database/type-orm' ] ``` I expect there /home/timur/dev/project/**src**/database/type-orm or at least /home/timur/dev/project/my-outDir-name/database/type-ormSteps to reproduce
What is Expected?
What is actually happening?