I was reading a booklet on formalism in quantum mechanics. Therein, I learnt that the wavefunction $\psi(\mathbf{r})$ is but just one way of representing the state of system which is a vector in Hilbert space in general, $|\psi \rangle$. This was called the position space representation of the state.
Then, it further stated that $\psi(\mathbf{r})$ is like coefficient in the expansion of $|\psi \rangle$ in the orthonormal basis $| \mathbf{r} \rangle$ (which were basically eigenfunctions of position operator):
$$|\psi \rangle = \int \textrm{d}^3r \ \psi(\mathbf{r}) | \mathbf{r} \rangle.$$
Now, since $|\psi \rangle$ is expanded in terms of $|\mathbf{r}\rangle$, both should be on the same footing, i.e, both should have the same units if any at all. But the formula suggests otherwise:
On the RHS, inside the integral, $\textrm{d}^3 \mathbf{r}$ has unit metre$^3$, $\psi(\mathbf{r})$ has unit metre$^{-3/2}$ as can be obtained from normalization condition. That leaves $|\mathbf{r}\rangle$. Now, no matter what unit you assign to $|\mathbf{r}\rangle$, you cannot at the same time, assign the same unit to $|\psi\rangle$ on the LHS. But the two seem to need to have same units.
Can someone please explain what's going on here?