jupyterlab / jupyterlab_server

A set of server components for JupyterLab and JupyterLab like applications

Home Page:http://jupyterlab-server.readthedocs.io/en/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notFoundUrl pageConfig persisted

mbektas opened this issue · comments

Description

notFoundUrl resent to browser with pageConfig with every JupyterLab load.

Reproduce

Expected behavior

  • Error message should be shown possibly once, and only if the non-existing URL was the initial JupyterLab URL being loaded.

Context

JupyterLab 3.4.8

Hi, while debugging some JupyterLab Desktop issues related to new features I am developing, I realized that jupyter server keeps returning previously not found URLs as part of pageConfig and that results in a dialog with the error message as shown below. If user mistakenly types an invalid path, this message would be shown at every JupyterLab reload since pageConfig persists the notFoundUrl config.

It seems to be caused by this line:

page_config["notFoundUrl"] = self.request.path

Also, if the non-existing path is part of initial URL entry then the popup is shown at that particular JupyterLab load. However, if the path was requested by javascript via fetch for example, then the popup will be shown at the subsequent JupyterLab loads, if any. The way I discovered the issue was, I opened dev tools and it requested source map file but couldn't load due to desktop app specific reasons, and next time I loaded JupyterLab it showed this "Path Not Found" error message.

I guess a solution could be to set page_config["notFoundUrl"] only for the initial JupyterLab URL load, if that was possible to detect.

jlab server path not found

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉