Getting "Warning: An error occurred while requesting the API" when opening Strapi

System Information
  • Strapi Version: 4.0.2
  • Operating System: Windows 10
  • Database: MySQL
  • Node Version: 16.13.1
  • NPM Version: 8.1.2
  • Yarn Version:

I’m trying to setup Strapi for the first time, and whenever I start up a development server using npm run develop I get “Warning: An error occurred while requesting the API” and am left with an infinite loading screen. I don’t see any errors in the command line. Does anyone know how to fix this?

Hey @F0ne,
What strapi version?

Are you following these instructions to create your strapi: Quick Start Guide - Strapi Developer Docs

Sounds like a environment issue. Do you get the same result using yarn?

I’m having the same issue.
npm runs the develop server correctly but I get the same infinite loading screen with that same error message, no errors in the console.

found this and it worked for me: Impossible to show admin page after local install · Issue #12010 · strapi/strapi · GitHub


npm run build 


npm run develop
System Info
  • Strapi Version: 4.0.4
  • Operating System: Windows 10
  • Database: SQLite
  • Node Version: 16.13.2
  • NPM Version: 8.3.0
  • Yarn Version: 1.22.17