Error while building new plugin, cannot find dist/server

Yes, that’s correct.
I got some errors while trying manual build, that led me to the conclusion that strapi’s build should do this.

The source of the problem was that react types were of version 17, while react was at 18 in package.json (typescript project on npm).