Develop mode hangs on first run

System Information
  • Strapi Version: latest
  • Operating System: windows
  • Database: lite
  • Node Version: 18.x
  • NPM Version: 9.x
  • Yarn Version:

Have an issue with strapi (using VS code), where when you do npm run develop it just waits forever and does nothing, but terminating the job and then npm run develop again it loads develop mode after a (big) like 1-2 min delay. The delay seems too long as well. No idea why though?

(dont even have big DB its just 4 collections and hardly any only about 40 data records at the moment)

Hi @timmy123 , If you’re experiencing delays and timeouts when running npm run develop with Strapi, there could be various reasons for this behavior. Here are some common issues and potential solutions:

  1. Port Conflicts: Ensure that the port Strapi is trying to run on is not already in use. Strapi defaults to port 1337, but if that port is occupied by another process, Strapi won’t start successfully. You can try changing the port in the config/server.js file.
  2. Database Connection Issues: Make sure your database is running and accessible. Check your database connection settings in the config/database.js file. If there’s an issue connecting to the database, it might cause delays or timeouts.
  3. Node.js and npm Versions: Ensure that you are using compatible versions of Node.js and npm as specified in the Strapi documentation. Mismatched versions can lead to unexpected issues. You can check the required versions in the engines section of the package.json file.
  4. Dependencies and Modules: Make sure all your dependencies are correctly installed. Run npm install to ensure that all required modules are present and up-to-date.
  5. Strapi Version Compatibility: Ensure that your Strapi version is compatible with the versions of your dependencies. Check the Strapi documentation and update your dependencies accordingly.
  6. Logging and Debugging: Increase the logging level to get more information about what Strapi is doing during startup. You can set the logging level in the config/log.js file. Additionally, you can run Strapi with the --verbose flag for more detailed output.
npm run develop -- --verbose
  1. Firewall/Antivirus: Check if your firewall or antivirus software is blocking any connections. Sometimes, security software can interfere with the startup process.
  2. Disk Space: Ensure that you have sufficient disk space available on your machine. Lack of disk space can lead to delays during the startup process.
  3. Strapi Cache: Strapi uses caching to improve performance. Try clearing the Strapi cache by deleting the .cache folder in your Strapi project and then restart the development server.
  4. Network Issues: If you’re working in a corporate environment, there might be network restrictions or proxies causing delays. Ensure that your network connection is stable and not blocking any outgoing requests.

strapi v4.15 takes way longer to start up since it rebuilds the full admin every time you run develop

verbose doesnt seem to work on run develop anymore for strapi 4

yes i just tested with strapi develop --no-build and it loaded within 10 sec!
No idea why that command is now deprecated, plus no idea why it hangs forever on the first attempt at running strapi develop.

Really is no need to fully rebuild admin each time if you havent changed anything!