I am attempting to deploy my NextJS/Flask application to Vercel, but I keep encountering an error stating “A Serverless Function has exceeded the unzipped maximum size of 250 MB.”
This error seems to be due to the number of Python dependencies in my requirements.txt file. I have managed to deploy successfully by reducing the number of libraries, but all of these dependencies will be required in the final production.
How can I deploy the application to Vercel with all the necessary Python dependencies?
# requirements.txt
alembic==1.13.1
annotated-types==0.7.0
anyio==4.4.0
blinker==1.8.2
certifi==2024.6.2
click==8.1.7
distro==1.9.0
Flask==3.0.3
Flask-Cors==4.0.1
Flask-JWT-Extended==4.6.0
Flask-Login==0.6.3
Flask-Migrate==4.0.7
flask-redis==0.4.0
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1
gunicorn==22.0.0
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
itsdangerous==2.2.0
Jinja2==3.1.4
Mako==1.3.5
MarkupSafe==2.1.5
marshmallow==3.21.3
numpy==1.26.4
openai==1.35.9
packaging==24.1
pandas==2.2.2
pillow==10.3.0
psycopg2-binary==2.9.9
pydantic==2.8.0
pydantic_core==2.20.0
PyJWT==2.8.0
PyMuPDF==1.24.7
PyMuPDFb==1.24.6
pypng==0.20220715.0
python-dateutil==2.9.0.post0
pytz==2024.1
qrcode==7.4.2
redis==5.0.7
setuptools==69.5.1
six==1.16.0
sniffio==1.3.1
SQLAlchemy==2.0.30
tqdm==4.66.4
typing_extensions==4.12.2
tzdata==2024.1
Werkzeug==3.0.3
WTForms==3.1.2
1