  Let $E_n$ be the $n$-th Euler number and $(a)_n=a(a+1)\cdots (a+n-1)$ the
rising factorial. Let $p>3$ be a prime. In 2012, Sun proved the that $$
\sum^{(p-1)/2}_{k=0}(-1)^k(4k+1)\frac{(\frac{1}{2})_k^3}{k!^3} \equiv
p(-1)^{(p-1)/2}+p^3E_{p-3} \pmod{p^4}, $$ which is a refinement of a famous
supercongruence of Van Hamme. In 2016, Chen, Xie, and He established the
following result: $$ \sum_{k=0}^{p-1}(-1)^k
(3k+1)\frac{(\frac{1}{2})_k^3}{k!^3} 2^{3k} \equiv p(-1)^{(p-1)/2}+p^3E_{p-3}
\pmod{p^4}, $$ which was originally conjectured by Sun. In this paper we give
$q$-analogues of the above two supercongruences by employing the $q$-WZ method.
As a conclusion, we provide a $q$-analogue of the following supercongruence of
Sun: $$ \sum_{k=0}^{(p-1)/2}\frac{(\frac{1}{2})_k^2}{k!^2} \equiv
(-1)^{(p-1)/2}+p^2 E_{p-3} \pmod{p^3}. $$
