Hi Matthew! I think the answer on the other question you posted will help you here. If you like my answer please upvote or mark as correct :)
can you change your environment variable on your local to Production? In development envt default service provider performs checks to verify that:
- Scoped services aren't resolved from the root service provider.
- Scoped services aren't injected into singletons.
This check is not performed on production so it does not throw the error on higher envts. However, this is still a problem that indicates that things were not set up properly. Fixing it on your local will only be an improvement. Because the way its set up now can result in multi threading issues and memory leaks.
This might help with proper refactoring. https://stackoverflow.com/questions/55089755/cannot-resolve-scoped-service