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 :
- Open your
package.jsonand check all your@strapidependencies 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. - Delete
package-lock.json - Delete
node_modules,buildand.cachefolders npm inpm run build