Edit: After several tests, simply deleting the composer.json and then running composer install seems to be a solution.
I haven't found the exact reason, but it appears that when using Git and the 'vendor' directory is in the .gitignore, executing composer install again can lead to problems. Typically, removing the 'vendor' and 'node_modules' directories, as well as the package.json and composer.json files, followed by running composer install and npm install should resolve the issue. Subsequently, based on your application, execute npm run dev followed by npm run build. If this doesn't rectify the problem, attempt to locate an older version of your 'vendor' directory and copy it into your project.