Cannot start admin in development mode

System Information
  • Strapi Version: 3.3.4
  • Operating System: Ubuntu 20 in WSL2
  • Database: default (sqlite)
  • Node Version: 14.9.0
  • NPM Version: 6.14.8
  • Yarn Version: 1.22.10


I am trying to launch the admin panel of Strapi in development mode in order to try out some changes in the upload plugin.
I followed the instructions in the contribution guide: strapi/ at master · strapi/strapi · GitHub

So I launch the getstarted application with yarn develop and the Strapi admin plugin too with yarn develop. The one starts on port 1337 and the admin on port 4000.
When going to localhost:4000/admin, I get an inifite Strapi loader in the middle of the page with the following error message in the console:

Access to fetch at 'http://localhost:1337/admin/init' from origin 'http://localhost:4000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

What do you think I am going wrong?
Thank you !

same issue here

Hey guys, Same issue here. Any update on this?

Update: Fixed this by rebuilding the admin panel

yarn build --clean

@ctessier were able to find the solution?

@sibi_sharanyan (yarn build --clean) didn’t resolve the issue. Do you know what caused your issue?

Actually the author of this post got confused by the development workflow of the strapi package, while he was trying to launch the strapi admin in development mode.

There is no need to run in development mode the strapi app and the admin panel. You should run only the Admin panel, as it already handles to run the app in the development mode.

So you should run just one command:

yarn develop --watch-admin

If you are still encountering some errors please try to delete build and .cache folders then try to rebuild it again and launch the Admin in development mode.