Problems viewing HTML file via JupyterLab on JupyterHub

Hi folks,

I’m trying to view an HTML file from the file system via JupyterLab on JupyterHub with GitHub authentication. The HTML file relies on CSS and JavaScript files which are in the same directory on the lab server’s file system. Although I can view the HTML file, the CSS and JS files fail to load.

This happens if I click on the HTML file and and try Open With > HTML viewer. or if I try Open In New Browser Tab.

Looking at the developer console in chrome, I can see the requests for the CSS and JS files are getting redirected to the hub login page. So I’m guessing this has something to do with my authentication not getting passed through to these requests somehow, but that’s where I run out of my depth I’m afraid.

Any help or advice appreciated. For context, this came up because I’m wanting to use Jupyter Book to build HTML sites and reports from Jupyter notebooks, and I’d like to be able to run the Jupyter Book build on my JupyterLab server and preview the HTML outputs locally before pushing any changes to the remote github repo for deployment.


Hi! Can you show us the logs from your developer console?

Have you seen jupyter-http-server?

My understanding was this was set up for developing and testing with Jupyter Book using MyBinder which is a modified JupyterHub, and so maybe it would help? See:

That sounds like exactly what I’m looking for, thanks so much!

Hi @manics, it looks like the answer from @fomightez might have solved this one for me, were you still interested in seeing logs?