This is one of the classic indeterminate forms of limit. The main warning sign of an indeterminate form, and hence a situation where "plugging in infinity" is particularly bad, is that you have two parts of the limit fighting to pull it in different directions so you can get different answers by plugging in infinity in different places.
With $y^x$, looking at what happens when $y \rightarrow 1$ and $x \rightarrow \infty$, if you try setting $y = 1$ then you get $1^x = 1 \rightarrow 1$ as $x \rightarrow \infty$, but if you instead start by taking $x \rightarrow \infty$ first then depending on the value of $y$ you have
$$y^\infty \rightarrow \begin{cases} \infty & y > 1 \\
1 & y = 1 \\
0 & 0 < y < 1 \end{cases}$$
which all don't depend on $y$, so they seemingly won't change when you take $y \rightarrow 1$. So even if we only look at the case for $y > 1$ (which matches the limit in your question), there's clearly tension between the base which is pulling the limit towards 1 and the exponent which is pulling it to an infinite value, meaning that any limit that looks like $1^\infty$ is indeterminate and you have to do extra work to determine the actual value - it's possible to have limits of this form that go to 1, and infinity, and every value in between.