Dev environment is flawless. Production doesn't work

I’m having an issue where my dev environment loads everything okay, no issues at all. As soon as I deploy to the live production environment, there is one component that just fails to load. It’s giving me 401 errors, and no matter how much troubleshooting I do and going back and forth with the Assistant and Agent, it simply will not resolve.

Is anyone here an auth specialist that can help me diagnose what is happening? It’s the last hurdle to launching this app. Happy to pay for your time.

I ran into a similar problem in my development process, which I documented in detail here: [Video Summary App] Follow my journey building a webapp as a non-coder - #7 by robinbobinpopin

Without knowing what you run into, I suspect it’s an API issue. My specific problem is that the API I was using was meant for ‘private use’: when I used it locally or during dev server, it works fine. As soon as it was deployed on a public server, YouTube blocks the API.

If that sounds like the issue you have, here are my suggestions:

  1. Look into alternative API (you may have to pay for it)
  2. Package the app to be running locally

Hope this helps you.

PS: I am not from Replit team. Just another Replit tinkerer

This is great info. I will do a check on the tools I’m using. I think they’re all open source, but who knows.

Actually come to think of it, it’s just the display that is broken. It wont return the proper data, but the actual function of the site (creating depth maps) is working - but wont display in production. If I log back in dev, the depth map i created in production is there and looks great. So all the API’s are working fine in production. It’s just an auth error.

I’ll check your link though, because maybe…

There are a few ways to test your theory!

I have tried downloaded the code and run it locally to verify if the code works. If it runs fine locally but fails in deployment, it probably means it’s something related to public IP.

i’ve had this type of error in many different instances 400 and 500 errors. currently grappling with a 502 error which after many hours researching and too many credits later im still non-the-wiser. hopefully if we keep this thread alive someone will be able to help

I think I figured out that it’s related to object storage. Still debugging.

You can open the documentation of the API and check the error code. It will typically tell you the reasons.

If your code works in dev environment but breaks in production, you should check it by deploying it locally first to see if the app works locally for you. If so it could mean the API you are using is blocked for public use so you either need to find workarounds or have a paid API.

I have mentioned in another thread that you can also try packaging the app to be a locall app using tools such as pyinstaller. It will work great for your personal use but you need to think about commercial use.