#405 Error When Deploying Medusa Backend to Vercel

1 messages · Page 1 of 1 (latest)

quick kindle
#

Hello, I am new here and new to Medusa and Vercel.
I am able to run Medusa in my local environment with no issues.
Today I started to deploy to Vercel, but running into some issue and find the Medusa Docs a bit confusing. I have tried many different combinations of my assumptions and still no success.
I followed the docs on how to deploy here:
https://docs.medusajs.com/deployments/admin/deploying-on-vercel.

I am able to build and deploy my Medusa Backend to the point where I see the Admin Login screen. But when I try to login I get a msg: "These credentials do not match our records." and when I inspect the console prints a "405 (Method Not Allowed)".

First I'm hoping someone can help me to align on some basic terminology.

  1. Is the Medusa"Backend" & "Admin" the same thing?
    Within the Docs, it mentions "Deploy Backend" & "Deploy Admin on Vercel"? I find this a bit confusing, buit it could just be me.

I followed the Deploy on Vercel instructions exactly and was able to get my "Admin" deployd to Vercel. I now see the Login Screen.

  1. The second thing I'm struggling with is the MEDUSA_ADMIN_BACKEND_URL. I have added the environment variable in the Vercel dashboard, but where do I find my MEDUSA_ADMIN_BACKEND_URL?
    I'm not using a custom URL.
    When I look at my Vercel project, I see 3 x URLs:
    a) Deployment URL that changes everytime there's a new deployment.
    b) Domains, in my case it is: "medusa-test-project.vercel.app"
    c) Then there is a +2 next to Domains and I also see:
    "medusa-test-project-cbdwells-projects.vercel.app"

Perhaps I'm completly missing something here. Any help will be much appreciated 🙂

  1. The third issue I'm struggling with is the last step in the Deployment Docs:
    "Configure CORS on the Medusa Backend".

The steps I took was to update the: "medusa-config.js" file as follow:
# Allow all HTTP requests
ADMIN_CORS=/http://*/

# CORS FOR PRODUCTION
STORE_CORS=/vercel\.app$/

Any and all help is welcome. TYVM

cerulean crater
#

did you ever figure out the solution??

hallow shale