Get 500 error on client side but 403 in terminal for the backend

Same problem here, but the solution was straightforward.

You must make sure that Strapi and all its dependencies have the exact same version number, otherwise you may end up having several implementations of the same stuff (ie error classes), in which case instructions such as instanceof ApplicationError might fail because the imported ApplicationError class differs from the one that was originally thrown.

The solution is :

  1. Open your package.json and check all your @strapi dependencies have the exact same version number as @strapi/strapi. For example, if you have "@strapi/strapi": "4.10.5", all dependencies should have "4.10.5" as version number.
  2. Delete package-lock.json
  3. Delete node_modules, build and .cache folders
  4. npm i
  5. npm run build
3 Likes