Description
Error: Can't get migration files: /workspaces/clone-tabnews/src/infra/migrations/1718242225526_test-migration.ts:2
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I get this erro if a try to run typescript migrations files, generated by node-pg-migrate -j ts create.
Its seems a ""ESM | commonJS"" problem, but in CLI i can run .ts directly
Suggested solution
In CLI i can run node-pg-migrate up with passing tsconfig.json as a flag with compilerOptions.module: "commonjs" to directly run .ts files, it would be nice if i could do the same in the programmatic approach
Alternative
No response
Additional context
No response
Description
I get this erro if a try to run typescript migrations files, generated by
node-pg-migrate -j ts create.Its seems a ""ESM | commonJS"" problem, but in CLI i can run
.tsdirectlySuggested solution
In CLI i can run
node-pg-migrate upwith passingtsconfig.jsonas a flag withcompilerOptions.module: "commonjs"to directly run.tsfiles, it would be nice if i could do the same in the programmatic approachAlternative
No response
Additional context
No response