I keep encountering a peculiar error that reads "cannot read subscribe of undefined". Interestingly, this error only seems to occur sporadically when the code is run on its own, but almost always arises during testing without focus. I'm at a loss as to why this error is appearing. I've attempted several solutions found on different websites, such as adding an afterEach loop.
If anyone can provide insight into why my code is producing this error, I would greatly appreciate it.