I need help: Adding even the smallest additional line of code to my master code causes streamlit to just show me a white screen

Friends, this is my first post and I need your help please :sleepy: :sob:.

Basically, I already have a fully functional app for what I need it for, however, there is a small change I need to make to one of the functions to improve the app. Itā€™s just adding a button, but when I add that to my master code (thatā€™s what I call my base code that does work) then when I deploy the app in Streamlit I only get a blank screen (I attach a screenshot)

That blank space on the right side is the error Iā€™m referring to. It happens EVERY time I try to add code to my master code. Even the smallest line of code causes that. Sure, then I simply go back to my master code and everything runs as it should. But I canā€™t add the new function I need.

Iā€™ve even asked GPT to review my code and I still donā€™t understand what the error is. Streamlit doesnā€™t give me an error message like when it comes to the code, only the screen goes blank, and although I can navigate to the other sections of my app nothing is shown at all, just the blank screen.

Could any expert give me a hand?

You might as well ask a human. There are quite a few of them around here.

Sure, could you help me mate?

How could I review the code without having the code? DI you forget to link your repo or something?

Sure, my bad mate.

This is my github repo: GitHub - GhostWriter27/SUVECOEX-2024-Simulation

I looked at your code and it doesnā€™t seem to be displaying anything outside of the sidebar. What do you expect to be displayed there and why?

It should actually, deploy the ENTIRE app.

The problem is this: I have the master code of my app, when I deploy THAT code the app works perfectly. To show you the problem, before sharing the repo with you, I deployed the new code (the one with the new functions I want to add) and it results in a blank screen.

Now, I redeployed the app, and if you log in with the credentials (which you can find inside the code) you will be able to see the app with all the functionalities.

The error itself, and why I am here asking for help, is because I cannot understand why when I try to add some new functionality to the master code, whatever it may be, even if it is just a line of code, when I deploy it it gives me that error of the blank screen.

If you enter the repo now and try to deploy the app, you will see that it works as it should.

Thereā€™s a TXT file in the repo, in case you need a little more context about the app, mate.

I deployed your updated code and I logged in with ā€œSgomezā€, ā€œA1B2C3D4ā€. A message ā€œHas iniciado sesiĆ³n correctamente.ā€ appeared in the sidebar, but nothing outside it.


I can try to troubleshoot that, but it doesnā€™t match your description so I am afraid I may be looking at the wrong code.

Try hitting log in again, mate. I donā€™t understand why, but you have to hit the login button twice.

It is not the additional code but the change in indentation. Take a look at the diff:

You changed the indentation of all lines from 397 to 425.

Hey mate, sorry, I didnā€™t respond yesterday because I wanted to try to solve the indentation thing first before posting here again.

I did the verification and deployed the app again, but as you can see, the white screen error appears again.

Could you take a look at the repo and give me your opinion?

The indentation is still messed up in your last commit. Compare it to the version that works.

Yes, you were absolutely right mate. The problem had to do with the indentation, and even though I asked GPT to verify that the indentation was correct, it kept getting it wrong. Since my knowledge of programming is zero, I couldnā€™t realize the indentation problem.

An apology, and thank you very much for your help friend. I really appreciate it!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.