Open durdenx opened 1 year ago
Same issue for Nx monorepos
Any update on this?
@aliameur, are you experiencing the issue using turborepo?
@durdenx, I am unable to reproduce your issue following the steps (with out docker, though). Could I get you to try again, so I can be sure the issue still exist for turborepo setups?
@olivermrbl Yes, I temporarily set shamefully-hoist = true
in the .npmrc
file as a workaround. Just remove this setting to get back to the initial issue.
@durdenx, any chance I could get you to update the repo (or a branch in the repo) to the reproducible state? I would like to be sure we have 1:1 setups.
@olivermrbl, I've updated the repository. Please make sure to run pnpm clean
and pnpm install
from the root to see the error.
@olivermrbl , no I am using a nx monorepo. It seems that @meduajs/admin
needs its depedencies in the same directory, and when you hack around it with nx, you start getting getting a load of dependency issues from the .cache folder.
Can I get you to try the following snapshots:
@medusajs/medusa@1.19.1-snapshot-20240108132634
@medusajs/medusa-cli@1.3.23-snapshot-20240108132634
Any or all of you.
@olivermrbl It's not working. After updating, I still encounter the same error: Module not found: Error: Can't resolve 'swc-loader'
Sorry, I should have added that my attempt will not solve the issue with the swc-loader
, only the issues related to babel and medusa executables. I realise this is what was initially reported – I apologise for the confusion my comment may have caused.
If you install the swc-loader
package (and the other failing one) separately in your project, as mentioned here, you should be able to resolve your issue.
This is not ideal. However, the issue will be permanently eliminated as we update our admin at the end of this month.
Even when I install swc-loader
, I then need to install all the admin dependencies (react, radix, etc.), and I encounter the following error: [@medusajs/admin] Could not find the admin UI build files. Please run "medusa-admin build" or enable "autoRebuild" in the plugin options to build the admin UI.
For now, adding shamefully-hoist = true
in .npmrc
is working well for me. I will wait for you to update Medusa Admin at the end of the month.
For is happening too, the workaround suggested by @durdenx works for me
Any updates on this? In which version is / was this expected to be fixed?
We have a monorepo and shamefully-hoist = true
only works globally within the repo and cannot be restricted to the medusa part only.
Bug report
Describe the bug
I'm encountering a bug when trying to integrate MedusaJS into a monorepo with TurboRepo. When attempting to run MedusaJS in this context, I'm receiving the following error:
This issue seems to be specific to
@medusajs/admin
v7, as it was working with the v6 in a similar setup.You can see a reproduction there : https://github.com/durdenx/medusa-turborepo.
main
branch for the non-working solutionworking-with-medusa-admin-v6
branch for the working solutionSystem information
Steps to reproduce the behavior
git clone https://github.com/durdenx/medusa-turborepo
cd medusa-turborepo
docker-compose up -d
pnpm install
pnpm dev
Expected behavior
I expected MedusaJS to run successfully within the TurboRepo monorepo environment.
Additional context
Related to #4532 and #5544
Any help or suggestions to resolve this issue would be greatly appreciated.
Thank you in advance for your assistance!