Let $G$ be a finite group, and $\rho:G\to GL(V)$ a complex representation. Recall that for an irreducible character $\chi$, the $\chi$-isotypic component $V[\chi]$ is the image of the $\chi$-isotypic projector $$ P_{\chi}:=\frac{\chi(1)}{|G|}\sum_{g\in G}\overline{\chi(g)}\rho(g), $$ and $V=\bigoplus_{\chi} V[\chi]$. $V[\chi]$ is characterized as the unique subrepresentation of $V$ such that every irreducible subrepresentation of it is isomorphic to the irreducible representation $W$ of $G$ with character $\chi$.
More generally, if $ G $ is a compact Lie group then there is still a decomposition into isotypic components $V=\bigoplus_{\chi} V[\chi]$ but now the projector is given by $$ P_{\chi}:=\frac{\chi(1)}{|G|}\sum_{g\in G}\overline{\chi(g)}\rho(g), $$ where now the sum denotes an integral over the compact group $ G $ with respect to the haar measure.
What about non-compact groups? When is there still an isotypic decomposition? Can the isotypic projectors still be constructed as above? Do we need something else like assuming that the noncompact group is reductive or that the representation is unitary?