Here the symbol "$\cong$" means isomorphic and $V,U ,W$ are vector spaces.
I couldn't find a counterexample but my work so far has showed that such counterexample cannot be finite-dimensional and obviously $W\neq\{0\}$.I've worked with polynomial spaces but no good ideas so far. Any hint is appreciated.
You're almost there.
It's like $\infty+1=\infty+0$.
More specifically, it follows from $\lambda+\alpha=\lambda$ for cardinals $\alpha\le\lambda$ if $\lambda$ is infinite: we can take any infinite dimensional $W$ and any $U,V$ of dimension $\le \dim W$, then we will have $$\dim(W\oplus U)=\dim W=\dim(W\oplus V)$$ hence $W\oplus U\cong W\oplus V$.
Even more specifically, let $W:=\Bbb R[x]$ as you suggest, let $U:=\{0\}$, $\ V:=\Bbb R$ and define the isomorphism $W\oplus V\to W$ by e.g. $(p,r)\mapsto r+x\cdot p$.