MikroOrm can't resolve drivers that i'm not currently using #208
-
Describe the bug Module not found: Error: Can't resolve 'pg' However, I am only using MySqlDriver. Stack trace
To Reproduce
Expected behavior
Additional context
Versions
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is caused by using a bundler, it's up to you to configure it properly and mark those dependencies as external. We mark all those as optional peer dependencies, I don't see what else I could do. I believe this is specifically a webpack problem, modern bundlers like vite should resolve this correctly and respect the optional peer dependencies. Note that some of those errors are coming from knex, not the ORM itself. |
Beta Was this translation helpful? Give feedback.
This is caused by using a bundler, it's up to you to configure it properly and mark those dependencies as external. We mark all those as optional peer dependencies, I don't see what else I could do. I believe this is specifically a webpack problem, modern bundlers like vite should resolve this correctly and respect the optional peer dependencies.
Note that some of those errors are coming from knex, not the ORM itself.