Closed dmiric closed 7 months ago
when developing on eg. Github Codespace then 'medusa develop' uses hardcoded localhost https://github.com/medusajs/medusa/blob/c3efac5a0d6cfa38e1af8d248138fa83934a8ceb/packages/medusa/src/commands/develop.js#L79
Maybe connected with this https://github.com/medusajs/medusa/pull/5022
https://github.com/medusajs/medusa/issues/5616#issuecomment-1820144427
Maybe there are other places where localhost is hardcoded in admin-ui build chain?
Yes hard coded localhost in develop.ts is where localhost comes from. I managed to sort it out by building admin separately with the same command that is used in develop.ts, but it would be better if that would be pulled from .env file.
Issue has been fixed in PR #7128 and will be part of the next release.
Bug report
Describe the bug
MEDUSA_BACKEND_URL from .env file gets overwritten so admin always uses localhost:9000
Additional context
I'm trying to split admin UI and backend to two different servers, admin UI is always sending requests to localhost:9000 no matter how I change .env variables or code in medusa-config.ts
According to documentation: https://docs.medusajs.com/cli/reference#develop I should be able to pass --host argument in --host but that arguments seems to be completely ignored.