For a matrix to be non-invertible, its determinant must be zero. We calculate the determinant of the given matrix and solve for \( x \) when it equals zero.
The determinant of a \(3 \times 3\) matrix is given by:
\[
\det(A) = a(ei - fh) - b(di - fg) + c(dh - eg)
\]
For the given matrix:
\[
A = \begin{bmatrix}
1 & 3 & 0 \\
2 & x & 4 \\
-1 & 0 & 2
\end{bmatrix}
\]
Calculating the determinant:
\[
\det(A) = 1 \cdot (x \cdot 2 - 4 \cdot 0) - 3 \cdot (2 \cdot 2 - 4 \cdot (-1)) + 0
\]
\[
= 1 \cdot (2x) - 3 \cdot (4 + 4)
\]
\[
= 2x - 3 \cdot 8
\]
\[
= 2x - 24
\]
Now, for the matrix to be non-invertible, we set the determinant equal to zero:
\[
2x - 24 = 0
\]
\[
2x = 24 \quad \Rightarrow \quad x = 12
\]
Thus, the value of \( x \) for which the inverse does not exist is:
\[
\boxed{12}
\]