-
-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error running generated migration #298
Comments
Sounds like a problem with your TS configuration, do you by any change transpile to ES5? |
How does the generated file look like and do you have Currently the |
I use a base Is there a way to define which In any case, thanks :) |
You would have to wrap the call with $ ts-node -p path/to/tsconfig.json node_modules/.bin/mikro-orm ... |
Not as clean, so I 'll make sure the base tsconfig contains everything required by mikro-orm. Thanks for the help! |
In next RC version you should be able to provide the path to tsconfig via |
So, this might be useful to someone who comes across this. The short answer for me that resolved this issue was setting target property of my tsconfig.json file, to "ESNEXT" |
same issue happens. package.json:
tsconfig.ts
|
error: Processing 'Migration20230616091813_init0516'
MigrationError: Migration Migration20230616091813_init0516 (up) failed: Original error: Class constructor Migration cannot be invoked without 'new'
at /opt/code/nodeSpace/nest/lv-main/node_modules/.pnpm/registry.npmmirror.com+umzug@3.2.1/node_modules/umzug/src/umzug.ts:259:12
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Umzug.runCommand (/opt/code/nodeSpace/nest/lv-main/node_modules/.pnpm/registry.npmmirror.com+umzug@3.2.1/node_modules/umzug/src/umzug.ts:208:11)
at Migrator.runInTransaction (/opt/code/nodeSpace/nest/lv-main/node_modules/.pnpm/registry.npmmirror.com+@mikro-orm+migrations@5.7.12_@mikro-orm+core@5.7.12_@mikro-orm+entity-generator@5.7.12_pg@8.11.0/node_modules/@mikro-orm/migrations/Migrator.js:301:21)
at PostgreSqlConnection.transactional (/opt/code/nodeSpace/nest/lv-main/node_modules/.pnpm/registry.npmmirror.com+@mikro-orm+knex@5.7.12_@mikro-orm+core@5.7.12_@mikro-orm+entity-genera_jwvymlb5k4coghsmkifoga533m/node_modules/@mikro-orm/knex/AbstractSqlConnection.js:36:25)
at /opt/code/nodeSpace/nest/lv-main/dist/apps/migrate/main.js:33:13
ELIFECYCLE Command failed with exit code 1. |
Describe the bug
I use the CLI command to generate a migration (
npx mikro-orm migration:create
), and when I try to run the migration (npx mikro-orm migration:up
) I get: TypeError: Class constructor Migration cannot be invoked without 'new'Stack trace
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Run the migration
Additional context
npx mikro-orm schema:create --run
works without issues, which makes me believe that the configuration is OK, regardless of the complex project structureVersions
The text was updated successfully, but these errors were encountered: