chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Blank page on every app

Open rafftod opened this issue 2 years ago • 16 comments

I've been trying to setup chainlit, but I always only get blank pages.

I tried chainlit hello as well as the example LLama Index integration with chainlit run app.py --host 0.0.0.0 --port 7860, and in both cases I end up with a full blank page.

Anything I should change ?

rafftod avatar Nov 03 '23 10:11 rafftod

Are you using WSL?

willydouhard avatar Nov 03 '23 11:11 willydouhard

Thanks for your answer! No, but I'm using a server that I know is probably encountering the same kind of issues.

To give an example, I previously tried to run text-gen-webui, and the definition of the root path was key to make js and css work.

I think I'm facing a similar issue here, because according to the network tab, I get 404 on js files.

rafftod avatar Nov 03 '23 12:11 rafftod

can you try to add -h to your run command? You might be encountering a problem where chainlit tries to open a browser where your server might don't have one.

willydouhard avatar Nov 03 '23 12:11 willydouhard

I tried, unfortunately it didn't change much. If I open the page in my browser, I get the exact same blank page. Also, I don't get any Python error in any case.

When I hit refresh this is what I get in the network tab (I run the app on port 7860):

image

rafftod avatar Nov 03 '23 12:11 rafftod

Can you ping on discord so we can have a short call? Will be easier to debug with screen sharing.

willydouhard avatar Nov 03 '23 13:11 willydouhard

As we are trying to use it on Domino Datalabs, and since it's a work laptop, I unfortunately can not screenshare 😅

rafftod avatar Nov 03 '23 13:11 rafftod

From our investigation, this comes back to this issue https://github.com/Chainlit/chainlit/issues/275

rafftod avatar Nov 03 '23 14:11 rafftod

So rather this one https://github.com/Chainlit/chainlit/issues/521

willydouhard avatar Nov 03 '23 14:11 willydouhard

Encountered similar issue - tried run the app at root directory but still displayed empty screen.

AllenJShi avatar Nov 30 '23 22:11 AllenJShi

Can you provide more details @AllenJShi ?

willydouhard avatar Dec 01 '23 10:12 willydouhard

Absolutely - so the major issue was due to reverse proxy, which all my requests should have been directed to https://xxx/chainlit_app_base_url/. However, only the initial request was routed correctly and the subsequent requests were submitted to https://xxx/n without the base url. I tried the subdir approach and CHAINLIT_URL env var suggested in other threads but it did not work. Would there be a more detailed solution or guidance for this particular issue?

Just saw a similar post at

Hi. This type of issue also occurs when I'm looking to use chainlit within Sagemaker Studio and using's it's Jupyter URL proxy to redirect traffic to the port.

e.g. an initial request can be sent to https://.studio.ap-southeast-2.sagemaker.aws/jupyter/default/proxy/8505 URL where the base URL is Sagemaker and the proxy.

External dependencies (some CSS and the like) will be rendered, but the subsequent calls to then return 404 errors. urlissue

Would it be possible to set something so that Chainlit allows requests to be sent to '/jupyter/default/proxy/8505' or similar so that the requests can be served as needed.

AllenJShi avatar Dec 01 '23 17:12 AllenJShi

So CHAINLIT_URL is mainly for OAuth redirections. We have no solutions for the subdir approach atm. Easiest way is to setup a subdomain and serve from the root of this subdomain.

willydouhard avatar Dec 01 '23 17:12 willydouhard

Thanks @willydouhard for the clarification! Could we expect to see this as a new feature in the near future though?

AllenJShi avatar Dec 01 '23 20:12 AllenJShi

Not in the immediate future but yes, down the road for sure

willydouhard avatar Dec 01 '23 21:12 willydouhard

I'm running into the same issue, since I'm deploying it behind an Application Load Balancer on AWS with multiple prefixes for multiple applications. One approach I've implemented for a different FastAPI app is to add middleware that removes the prefix from the path, however I didn't seem to manage to do that here. Are there any tips for that?

omrihar avatar May 09 '24 12:05 omrihar

This was happening to me and I discovered something was already running on port 8000. I assumed it would error out on that condition.

jkolyer avatar May 19 '24 01:05 jkolyer