Okay, I just found an answer, in the paper http://www.few.vu.nl/~dijkstra/research/papers/sinecurve.pdf. The answer is no; just take a "punctured topologist's sine curve"
$$ X \ := \ \{(0,y) : y \in [-1,1) \} \, \cup \, \{ (x,\sin(\tfrac{1}{x})) : x \in (0,1] \}. $$
It is clear that for every $r \in [-1,1)$, if $A$ is a connected neighbourhood of $(0,r)$ then $A$ contains $\{ (x,\sin(\tfrac{1}{x})) : x \in (0,\varepsilon] \}$ for some $\varepsilon>0$; but then if $A$ is also closed, then $A$ must also contain $\{(0,y) : y \in [-1,1) \}$. So $A$ cannot be compact.