vercel-community / php

🐘 PHP Runtime for ▲ Vercel Serverless Functions (support 7.4-8.3)

Home Page:https://php.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Files not getting excluded when deploying from GitHub Integration

DenverCoder1 opened this issue · comments

Bug report

Description

When automatically deploying from GitHub, the excluded files are not getting removed since I am getting the error:

Error: The Serverless Function "api/index" is 650.74mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size

If the images directory is excluded, the project would be significantly under this limit.

When deploying manually with vercel --prod, it works just fine. The issue only occurs with Git deployments.

I have tried both using .vercelignore containing images, and using a vercel.json with excludeFiles:

{
    "functions": {
        "api/index.php": {
            "runtime": "vercel-php@0.5.2",
            "excludeFiles": "{images/**,.github/**}"
        }
    },
    "routes": [{ "src": "/(.*)", "dest": "/api/index.php" }],
    "github": {
        "silent": true
    }
}

Neither of these approaches fix the issue of GitHub deployments failing.

Screenshot

image

As a workaround, I disabled the Vercel GitHub integration and I'm using a GitHub action instead.

https://github.com/DenverCoder1/minimalistic-wallpaper-collection/blob/main/.github/workflows/vercel-deploy.yml

The vercel and vercel --prod commands work just fine, but there still seems to be a bug with the automatic builds.