Factory, missing dependencies exceptions post laminas-di removal

Just posting this for those having issues they can not solve due to factory issues etc.

If you have laminas-di listed in your dependencies, ie you selected to install it during the skeleton create-project routine, and have since removed it. Or, you are getting unresolved dependency errors etc. You might want to look into if your project is using laminas-di.

During the skeleton install, ie, composer create-project …, it will prompt you to install laminas-di. Just as an example of how this can cause new users issues. For example, since you are new, you select to install this component. Then you add laminas/laminas-authentication. You get it working as outlined in the docs then at some point you review your deps in the top level composer.json for your project. You see laminas-di listed but you are sure you are not using it and you remove it.

On the next browser reload you will be greeted with an exception that is very vague. Something to the effect of not able to resolve some dependency etc etc. It is due to the laminas-di AbstractFactory jumping in and autowiring an instance. If you look in, following the example, the laminas/laminas-authentication package you will notice that it does not provide a factory or autowiring for a factory for the authentication package.
What happened is that the laminas-di Abstractfactory jumped in due to ITS autowiring and attempted to use reflection to autowire you an instance of AuthenticationInterface ie AuthenticationService on the fly. Since you removed laminas-di in the intermediary step this is no longer possible and you get an error.

Just posting this as a possible help to those running into the issue that are new to the framework. Hope it helps.