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

PNP & MikroOrm + NestJS #195

Closed
5 tasks done
lmnogues opened this issue Dec 19, 2024 · 3 comments · Fixed by #204
Closed
5 tasks done

PNP & MikroOrm + NestJS #195

lmnogues opened this issue Dec 19, 2024 · 3 comments · Fixed by #204
Labels
help wanted Extra attention is needed

Comments

@lmnogues
Copy link

Describe the bug

In a repo configured to use yarn pnp, there is some issue on the configuration used by mikroOrm to start

I've put the following repo to demo the issue
https://github.com/lmnogues/mikro-orm_nestjs_pnp_issue

In the file mikro-orm.config.ts i've not setup the configUrl because I want it to be provided by the configuration module.
The migration will run, but the project will not start.

If we reset yarn to use "node-modules" by changing the .yarnrc.yaml and re-install/build & run the project it will run properly.

Reproduction

yarn install
yarn build
yarn dev

What driver are you using?

@mikro-orm/postgresql

MikroORM version

6.4.1

Node.js version

node 22.12.0 / typescript 5.7.2

Operating system

all

Validations

@B4nan B4nan transferred this issue from mikro-orm/mikro-orm Dec 19, 2024
@B4nan
Copy link
Member

B4nan commented Dec 19, 2024

If you think it's about the ORM itself and not the Nest adapter, please provide a repro without nest involved, but my guess is its about it, so moving the issue to this repo.

I can imagine its caused by the tryRequire we do, which fails with the useFactory that has required params. See #184 for proposed solution, maybe you could verify locally if its about this.

@B4nan B4nan added the help wanted Extra attention is needed label Dec 19, 2024
@lmnogues
Copy link
Author

Sorry for the missplaced issue :)
I'll try the #184 workaround and get back quiclky.

@lmnogues
Copy link
Author

lmnogues commented Jan 2, 2025

The #184 workaround seems to be working, but it's very unintuitive. At lease it should be documented somewhere in the docs and not in an "Unanswered" issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants