xenial-black
xenial-black10mo ago

Using refine in monorepos

Hello, please tell me is it possible to run refine in monorepo? I'm getting a "refine core package not found" error. It seems that getInstalledRefinePackages is not designed for the monorepo case.
4 Replies
conscious-sapphire
conscious-sapphire10mo ago
Hey @ha_sash, you can use refine in monorepos and we have couple of examples that demonstrates refine in monorepos. Monorepo with turbo https://refine.dev/docs/examples/build-systems/turbo/ Monorepo with lerna https://refine.dev/docs/examples/build-systems/lerna/ Usage with nx https://refine.dev/docs/examples/build-systems/nx/ Let me check the @refinedev/cli's issue you're having. I'll try to send you and update as soon as possible
exotic-emerald
exotic-emerald10mo ago
Hello! Thanks for the answer. I'm using a monorepo "oao". And I tried creating a monorepo with Lerna, it worked. But when I copy this project to my repository I get this error. I didn't find any difference in the configurations. Changing cli.js helps to run the project 🙂
conscious-sapphire
conscious-sapphire10mo ago
Yeah found the issue about it. We're running a check before running the devtools to see if the project has a compatible core version. In some monorepo setups, the method checking the core version fails to locate it and could not find the version which throws as "refine core package not found" but it was actually not a blocker to run the development server 😅 I've opened a PR for it fixing the issue and also updating the check to cover monorepos. https://github.com/refinedev/refine/pull/5151 While waiting for this to release, you can try adding --devtools=false argument to your dev script and check if its working 🚀 Hey @ha_sash we've released @refinedev/cli@2.16.12 with the fix 🙏
exotic-emerald
exotic-emerald10mo ago
Thank you very much! It was very fast, I didn't expect it! I updated and it works!