I just removed two bathroom vanity lights to replace them and discovered that there was no junction box behind either. One light was mounted over a stud and the other was right next the a stud.
At first I thought I could use old work pancake boxes, but the problem is that in both cases, the in-wall wiring runs directly over the stud. So there's not really room to even fit a pancake box in there. I could move the entire fixture to the left or right, but then my fixture is off center and I'll have a hole to patch where it used to be mounted which might not even be possible since the romex runs over the stud where drywall would need to go.
Any ideas on how to proceed?
(Also curious why the romex would even be run like this instead of through the studs? It is an exterior 2x6 wall, FWIW).