nglview does not work if frontend (nglview inside the environment from which the JupyterLab starts) and backend (nglview inside the environment with the kernel the user is using) versions do not match. nglview inside user environments should always be 3.1.4 (except for cases when user installs matching versions of nglview inside kernel and JupyterLab environments and specifies the JupyterLab environment in the app form). Also nglview uses deprecated module pkg_resources, so setuptools<82 is needed. setuptools<80 does not even show the warning, in case it bothers you.
Installation of nglview:
conda install -n <ENVIRONMENT> -c conda-forge -y nglview=3.1.4 "setuptools<80"