Yes, there is. Conceptually, imagine a flow on $\mathbb{R}^3$ with a single closed orbit on the unit circle in the plane $z=0$, while every other trajectory has an increasing z-coordinate. It's then easy to embed that flow in $\mathbb{R}^4$ to get the foliation you want.
More precisely, consider the vector field $$f(x_1, x_2, x_3, x_4) = (-x_2, x_1, (1 - x_1^2 - x_2^2)^2 + x_3^2, x_4)$$
It has no zeros, because if the third coordinate is zero, then at least one of the first two coordinates is nonzero. So the flow given by $x'= f(x)$ defines a 1D foliation of $\mathbb{R}^4$.
And it has exactly one closed orbit (i.e. compact leaf), the circle of the form $(a, b, 0, 0)$ where $a^2 + b^2 = 1$. To see this, note that the 4th coordinate has to be zero in a closed orbit, and that the quantity $x_1^2 + x_2^2$ is constant on flow trajectories.