0

So I recently refactored my Flask application so that everything is not in one giant app.py file: models, routes, config, etc. After doing this it runs fine locally, but when I push everything to GitHub, Vercel tries to build the serverless function from my most recent push and the build succeeds but I get an Internal Server Error when I go to my url. I'm unsure if the issue is with my vercel.json file calling the wrong src/dest or if a package I'm using is not supported by Vercel (though I'm using the same Python version that Vercel uses so that shouldn't be a problem).

The source code is in my GitHub (https://github.com/adam-bartholomew/encode-message).

Has anyone seen a problem like this and know where I can begin debugging?

Images:

Vercel Runtime Logs

Vercel Internal Server Error

I tried changing my vercel.json file a few times based on what Vercel has on it's website but that didn't correct the issue, it actually caused the build to fail.

2 Answers 2

0

I solved my own problem; there was a mistake in one of the environment variables set up on Vercel. I corrected the environment variables and my next build succeeded.

The SQLAlchemy connection uri is supposed to begin as "postgresql:...". My environment variable that holds this was set to the default that Vercel creates which begins as "postgre:...".

Sign up to request clarification or add additional context in comments.

Comments

0

You need to run the vercel application in a development mode using the following command in order to know where you flask application crashes.

vercel dev

After this you doing this you will get to know which file / module / package is actually causing the crash and you should be able to fix it.

For me, the issue was related to Flask version that I was using so I had to downgrade my flask version to a lower major version.

More information over here - https://github.com/orgs/vercel/discussions/2217#discussioncomment-7563760

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.