digitros / nextjs-fastapi

https://nextjs-fastapi-starter.vercel.app
MIT License
408 stars 117 forks source link

Doesn't work on vercel #15

Open arslan2012 opened 7 months ago

arslan2012 commented 7 months ago

Just by adding a few python dependencies, the vercel build will time out and fail

reproduction:

diff --git a/requirements.txt b/requirements.txt
index 1428c53..384a2ad 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,9 @@
 fastapi==0.100.1
-uvicorn[standard]==0.23.2
\ No newline at end of file
+uvicorn[standard]==0.23.2
+librosa==0.10.1
+pydantic==2.5.3
+scikit_learn==1.3.2
+scipy==1.11.4
+torch==2.1.2
+transformers==4.36.2
+python-multipart

Screenshot 2024-01-15 at 2 39 04 PM

AGI-CEO commented 7 months ago

I have same issue and saw this post (https://github.com/orgs/vercel/discussions/4354) which looks promising, however I'm probably going to deploy the fastapi backend elsewhere.

Looks like you're also building an AI nextjs app. If you're looking for free deployment, you can deploy your fastapi to render and redirect your frontend api request while keeping the frontend deployed to vercel

arslan2012 commented 7 months ago

yeah non of the suggestions on thatpost worked for me. I think there's somthing wrong with the vercel build process, it keeped downloading multiple copies of the python dependency and racked it up to 5GB. deleting .next folder didn't help.

Since this is just my passion project, and I don't know any other hosting that hosts python for free. I might just sit this one out, until python runtime is out of beta on vercel.