-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Starting from 1.12.1
unable to start medusa
#4532
Comments
We use Medusa in a mono repo using turbo repo, and aswell after upgrading beyond v1.12.0, we get this same error. Reverting to v.1.12.0 resolves the issue. |
Digging through the changes, the medusa-cli has been converted to typescript, so I wonder if it could be related? |
Sorry for late answer, I didn't had time to dig through medusa source code to investigate problem but i have a partial solution. What I did was to use nohoist option in yarn workspaces like bellow, which forces medusa to be installed locally instead of being in root. // package.json
// ...
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/@medusajs",
"**/@medusajs/**",
"**medusa**"
]
}
// ... Note: Problem with this approach is if u have any customized version of medusa plugins in your packages directory. You won't be able to use it (i think). Since all services importing base classes from medusa (like TransactionBaseService, NotificationService etc...), i think it's going to cause problems because when nohoist is used it will install medusa separately for each local package. Which will cause plugins to import seperate versions of medusa interfaces. |
We can start our medusa server with no issues via |
Same here except Apart from removing a relative |
I also have this issue and have tried looking through the changes from v 1.12.0 to 1.12.1 v1.12.0...v1.12.1 |
We ran into this issue as well using Turborepo. A workaround we applied for now is to make a symlink:
Where Also not sure if related to this issue, but we needed to install the NPM packages |
As of 1.18.1, this is still an issue. Haven't upgraded recently because of the pain of doing a custom patch every time we do. I had to rework our yarn lock file to debug an issue tonight and encountered the same ceremony again. Might I suggest the dev CLI use some sort of resolver function to locate the babel and medusa bin commands...something that can traverse parent directories to find them in the root of a monorepo? A workaround is listed above to disable hoisting, but that doesn't work for us because then the custom services we have don't resolve to the same core medusa module and the services don't get loaded properly. |
In #5952, we introduced If the executable is missing, something is wrong with your setup, and the issue should be resolved elsewhere – likely by ensuring the CLI (babel, or in this case, medusa) is installed correctly. Using I can open a PR and publish a snapshot if you would be up for running a test. Let me know. Also, if there are any downsides to this approach that I haven't identified, please shout. |
Sounds like a reasonable solution to me. Can't wait to try it out!
|
@ripvannwinkler, could I get you to try out these snapshots:
Please note, these will not resolve the issue with the |
@olivermrbl it does appear to run without any patches, but I'm encountering something else weird - might be an artifact of an outdated or missing reference otherwise. When I run medusa develop in the backend project on windows, it tries to open babel.js via the shell command, which triggers a popup asking me which program I want to use to open the file. Whether I cancel the popup, or open in a text editor, the develop command seems to finish executing successfully, but clearly something else is going on. Additionally, my project is in a directory that contains spaces in the name which originally caused the command to fail outright. Maybe needs some work on quoting the commands. I cloned the project to a dir without spaces in the drive root and it worked fine otherwise. I'll try on my Macbook later to see if the same issue occurs, but any insight you can offer would be helpful. I also noticed with the 1.19.1 snapshot, typeorm has been replaced by mikroorm. I didn't change anything in our code base to accomodate as this was purely a cli test, but I'm sure that's unrelated to the babel shell open issue mentioned above, as everything appears to run without issue otherwise (nothing extensive on the ORM use in our added services, just a few queries which may need tweaking). |
Hey, thanks for the report! Since v2 brought a lot of architectural and API changes on the backend, we will be closing this ticket since it no longer applies to our new setup, or the issue has already been fixed. If you are still facing issues with v1, |
Starting from version
1.12.1
i am getting following error when ever i runmedusa develop
.I am using yarn monorepo setup with following structure
package.json
Error i am getting
I think cause of this is, Medusa started assuming
@medusajs/medusa/dist/bin/medusa.js
is always at package level as seen from error/home/quiloos39/Documents/traumkaffee/packages/backend/node_modules/@medusajs/medusa/dist/bin/medusa.js
. But it's not certain because we don't know depending on other packages it could be either installed at package level or root level so in my case because of medusa was residing in root level it didn't work.The text was updated successfully, but these errors were encountered: