#Deploying my project

1 messages · Page 1 of 1 (latest)

valid tendon
#

Hi, so right now I have my project working with postgres, I use meilisearch, minIO and medusa admin what I ejected and customized, all locally right now. I want to deploy it live, so my friend can also see it etc. I looked into docs and tought I will deploy backend to Railway and storefront to Vercel right now. What exactly I need to do, to deploy it, because right now im lost. I have backend and storefront pushed to github. I also tried to deploy my backend repo on Railway but I get errors, I followed medusa docs. It's first time I'm doing it so yeah, if someone can help, would mean a lot.

valid tendon
#

.

modest hinge
#

The error tells you information on how to fix it. You need to update the version of the peer dependency in your customized admin to match the version of your server.

#

#11 4.100 npm ERR! Fix the upstream dependency conflict, or retry
#11 4.100 npm ERR! this command with --force, or --legacy-peer-deps

valid tendon
#

so I go into customized medusa admin if I'm correct, and what exactly I need to run there?

valid tendon
#

I think I fixed it with yarn upgrade --scope @medusajs/medusa --latest because now the build was successful.

valid tendon
modest hinge
#

The error log tells you why:
[medusa-config] ⚠️ redis_url not found. A fake redis instance will be used.

On a service like railway, fake redis will run out of memory quickly, if it even manages to get up and running at all.

#

I also think railway will not be able to build the admin. Someone else posted about that. You will need to build it before you deploy.

valid tendon
valid tendon
modest hinge
#

Please stop tagging me. No one here is tech support. I pointed you in the right direction (your redis instance is not congured, and you need to build your admin before you deploy), but I'm not going to research and resolve your issue for you. You know what you need to do now and can search Discord, Google, and the docs.

valid tendon
#

Okay, no problem, i will try

valid tendon
#

So I got so far, I got my backend up on railway, i got my storefront deployed and connected with medusa server, can also see changes in the deployment log. Now I have customized medusa admin deployed on Vercel, I see log in page, I also added STORE_CORS and ADMIN_CORS, but if i refresh my medusa admin depolyment site I get this error.

valid tendon
#

.

torpid blade
valid tendon
torpid blade
#

You can use those domains .railway and .vercel as they are on the public suffix list so they will get blocked by CORS.

https://publicsuffix.org/

You need to add your own domain that you own.

pure lodge
#

No, public suffix domain just don't set cookies

torpid blade
#

True

#

But still wont work and needs to be addressed, but this issue is because you havent updated ADMIN_CORS

pure lodge
valid tendon
#

So you mean I need to own domains to get it working live? With those generated domains by Vercel etc, doesn't work?

pure lodge
#

You can try, but not sure if the cookie will be set. You may have trouble logging in into admin or customers logging in.

#

As for now you can set ADMIN_CORS to that generated vercel domain

#

To have the CORS error go away

valid tendon
#

But I did set it, it's set to Vercel deployed url, with .app ending.

pure lodge
#

with https and no trailing slash?"

valid tendon
#

yeah, I also tried both ways.

pure lodge
#

have you rebuilt/restarted backend?

valid tendon
#

so you mean every url server etc should be without / ending?

#

they are without it by default, but if I copy them, they come with / automatically.

pure lodge
#

Then you need to remove it when setting the env vars

#

But still most likely for production you will need your custom domain.
It's not a medusa limitation but how browsers work.

valid tendon
#

Okay, good to know, then its not worth even trying right now, I thought I could show it live in the school, but I think, then I need to show it locally.

pure lodge
#

Do you want to show the admin or store?

valid tendon
#

Both, I think

pure lodge
#

For using the store without customers logging in, you won't need a custom domain either.

#

as cookies are not required

valid tendon
#

maybe, I will try.

#

but, I use customized admin, I think it's a problem?

pure lodge
#

Then yes, you'll need to eject

#

I would start with fixing the cors env vars

valid tendon
#

The admin that is deployed to vercel, is ejected one

pure lodge
#

But it's still not guaranteed to work without custom domains

#

As I said, first fix the CORS issue by setting proper env vars

valid tendon
#

I will try without / , but yeah I think it will not work.

#

It worked