Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entire project is sent to each builder #103

Closed
unitof opened this issue Aug 6, 2020 · 3 comments
Closed

Entire project is sent to each builder #103

unitof opened this issue Aug 6, 2020 · 3 comments
Assignees

Comments

@unitof
Copy link

unitof commented Aug 6, 2020

Bug report

Description

It appears that all files in the now Vercel project root (where .vercel and/or now.json are kept) are being sent to the builder for each Serverless Function. It's causing my builds to fail, as my repo as a whole is well over the Lambda max of 50MB, even though each Serverless function is well below that.

My understanding is that each Serverless Function should, by default, include only its own .php file, plus any matching files explicitly specified in that function's includeFiles in now.json.

The example at the repo above is nearly identical to the vercel-examples/php example, just with a 100MB nonsense zip file added to the root directory. It fails to build because Error: The Serverless Function "api/index.php" is 127.22mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size.

@unitof unitof changed the title Entire project is being sent to builder Entire project is being sent to each builder Aug 6, 2020
@unitof unitof changed the title Entire project is being sent to each builder Entire project is sent to each builder Aug 6, 2020
@reed-jones
Copy link

(If I'm understanding properly) I think thats intended. For example check out the Lumen example: https://github.com/juicyfx/vercel-examples/tree/master/php-lumen api/index.php just pulls in the main lumen app entry file from the root of the project.

I'm not sure, but maybe adding your zip to the .nowignore .vercelignore would work? https://vercel.com/guides/prevent-uploading-sourcepaths-with-vercelignore

@f3l1x
Copy link
Collaborator

f3l1x commented Aug 7, 2020

It's the feature. You must use . vercelignore and ignore all files/folders you don't want to upload.

@f3l1x f3l1x self-assigned this Aug 7, 2020
@unitof
Copy link
Author

unitof commented Aug 7, 2020

Gotcha, my mistake then. I assumed it did some static analysis like some of the other runtimes to determine which files are required. I now see it just includes the whole directory where .vercel resides by default.

I don't want to .vercelignore the files in my root, as I want them to be served statically, but I'll use excludeFiles instead.

Which does lead me to a new bug, which I just reported: Vercel now requires includeFiles and excludeFiles to be a single glob pattern, but vercel-php still expects arrays.

@unitof unitof closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants