Bayes' theorem (simplified): $P(A|B) = \frac{P(A) \times P(B|A)}{P(B)}$
Per the books/teachers I've had the honor to meet, the probability of an event $P(E)$ is such that $0 \leq P(E) \leq 1$ i.e. $P(E) = 0$ is possible.
But if $P(B) = 0$ then, $P(A|B) = \frac{P(A) \times P(B|A)}{P(B)} = P(A|B) = \frac{P(A) \times P(B|A)}{0} =$ undefined.
How do I resolve this problem, if it is a problem in the first place?
$P(B) = 0$ means that $B$ itself is impossible, or at least impossible to have happen "randomly". Which means among other things that $P(B|A)$ is also $0$, so really you have $0/0$, which is indeterminate and could take on any limiting value, which makes sense, you're asking about impossible situations here.