Search code examples
node.jsstrapi

Strapi Cloud deployment error "There was an unknown error response from the API"


I am using Strapi with Vite app as frontend which worked well in local environment. I deployed the Strapi project on cloud.strapi.io and it was built successfully, but when I try to register admin, it shows error as There was an unknown error response from the API.

I don't know what went wrong :(

github folder structure:
repo
--client
--server

Strapi - 4.24.2
NodeJs - 20.14.0


Solution

  • Just changed my code in config/server.js

    // host: env("HOST", "0.0.0.0"),
    // port: env.int("PORT", 1337),
    // url: "http://localhost:1337",
    url: "https://<strapi-project-name>.strapiapp.com/",
    

    Adding this URL worked and the project is up and running as expected.