Skip to content
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

fix: await useFactory resolution when registering Mikro ORM with forRootAsync #166

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

SteadEXE
Copy link
Contributor

@SteadEXE SteadEXE commented Apr 15, 2024

When MikroORM's module is loaded with forRootAsync, it throws an error if useFactory is async or returns a promise :
No driver specified, please fill in the `driver` option or use `defineConfig` helper (to define your ORM config) or `MikroORM` class (to call the `init` method) exported from the driver package (e.g. `import { defineConfig } from '@mikro-orm/mysql'; export defineConfig({ ... })`).

This is understandable because factoryOptions is now a promise instead of the options object itself.

It makes sure that createMikroOrmAsyncOptionsProvider uses the result of the promise instead of the promise itself.

Copy link
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@B4nan B4nan merged commit ae637bd into mikro-orm:master Apr 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants