In $\Bbb R$ in the discrete metric/topology, a subset $A$ is compact iff $A$ is finite. So e.g. take $A_n = \\{n\\}$, all compact, and then $\Bbb N = \bigcup_n A_n$ is not compact. So it already fails with countable unions of finite sets.
In $\Bbb R$ in the discrete metric/topology, a subset $A$ is compact iff $A$ is finite. So e.g. take $A_n = \\{n\\}$, all compact, and then $\Bbb N = \bigcup_n A_n$ is not compact. So it already fails with countable unions of finite sets.