We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
When running migratior.up() on bun I'm getting migration error as MigrationClass is undefined.
MigrationError: Migration Migration20240318042632 (up) failed: Original error: undefined is not a constructor (evaluating 'new (Object.values(migration))[0](this.driver, this.config)') info: { "direction": "up", "name": "Migration20240318042632", "path": "/mikro-orm-elysia/src/migrations/Migration20240318042632.ts", "context": {} } at new ErrorWithCause (/mikro-orm-elysia/node_modules/pony-cause/lib/error-with-cause.js:4:12) at new MigrationError (/mikro-orm-elysia/node_modules/umzug/lib/umzug.js:45:9) at /mikro-orm-elysia/node_modules/umzug/lib/umzug.js:177:31 196 | } 197 | resolve(params) { 198 | const createMigrationHandler = async (method) => { 199 | const migration = await core_1.Utils.dynamicImport(params.path); 200 | const MigrationClass = Object.values(migration)[0]; 201 | const instance = new MigrationClass(this.driver, this.config); ^ TypeError: undefined is not a constructor (evaluating 'new (Object.values(migration))[0](this.driver, this.config)') at /mikro-orm-elysia/node_modules/@mikro-orm/migrations/Migrator.js:201:50
Doing some debugging it appears that the Object.values returns an empty array from the dynamic import object on Bun
mikro-orm/packages/migrations/src/Migrator.ts
Lines 250 to 251 in 8799461
I'm currently using the following workaround, will open a PR if this workaround is also compatible with all supported runtimes
const migration = await Utils.dynamicImport(params.path!); const fileName = params.name.split('.')[0]; const MigrationClass = migration[fileName];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When running migratior.up() on bun I'm getting migration error as MigrationClass is undefined.
Doing some debugging it appears that the Object.values returns an empty array from the dynamic import object on Bun
mikro-orm/packages/migrations/src/Migrator.ts
Lines 250 to 251 in 8799461
I'm currently using the following workaround, will open a PR if this workaround is also compatible with all supported runtimes
The text was updated successfully, but these errors were encountered: