{"id":16547657,"url":"https://github.com/sambecker/now-function-size","last_synced_at":"2025-10-28T16:31:40.726Z","repository":{"id":38781243,"uuid":"253361578","full_name":"sambecker/now-function-size","owner":"sambecker","description":"Minimal example of cross-function lambda sizing issue","archived":false,"fork":false,"pushed_at":"2023-01-07T04:37:30.000Z","size":867,"stargazers_count":2,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-07T13:12:10.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sambecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-06T00:39:57.000Z","updated_at":"2022-08-20T20:12:07.000Z","dependencies_parsed_at":"2022-09-18T03:42:44.271Z","dependency_job_id":null,"html_url":"https://github.com/sambecker/now-function-size","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambecker%2Fnow-function-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambecker%2Fnow-function-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambecker%2Fnow-function-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambecker%2Fnow-function-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sambecker","download_url":"https://codeload.github.com/sambecker/now-function-size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219859164,"owners_count":16556037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T19:22:31.440Z","updated_at":"2025-10-28T16:31:40.277Z","avatar_url":"https://github.com/sambecker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## My Issue\n\nI can deploy either of my two endpoints but not BOTH:\n\n- `pages/api/test-api.ts`\n- `pages/api/test-api-alt.ts`\n\nIf I delete one of these files my app deploys succeeds. If I leave them both in, it fails.\n\nJudging by the file size error, it seems ALL dependencies get bundled with EVERY endpoint.\n\nRelated Github discussions:\n\n- https://github.com/zeit/now/discussions/4041 (dependency pollution across apis)\n- https://github.com/zeit/now/discussions/4013 (dependency pollution across pages AND apis, which appears to be fixed)\n\nZeit/now error logs:\n\n```\n9:51:12.236  Compiled successfully.\n09:51:12.236  Automatically optimizing pages...\n09:51:12.843  Page                                                           Size     First Load JS\n09:51:12.843  ┌ ○ /                                                          6.94 kB        64.9 kB\n09:51:12.843  ├ ○ /404                                                       3.15 kB        61.1 kB\n09:51:12.843  ├ λ /api/test-api\n09:51:12.843  ├ λ /api/test-api-alt\n09:51:12.843  └ λ /test-page                                                 293 B          58.2 kB\n09:51:12.843  + First Load JS shared by all                                  57.9 kB\n09:51:12.843    ├ static/pages/_app.js                                       957 B\n09:51:12.843    ├ chunks/e2e2e76c8bf507b2d0f54f2e5110e7a0e38cd0f7.92878c.js  10.3 kB\n09:51:12.843    ├ chunks/framework.0f140d.js                                 40 kB\n09:51:12.843    ├ runtime/main.7e74ef.js                                     5.95 kB\n09:51:12.843    └ runtime/webpack.b65cab.js                                  746 B\n09:51:12.844  λ  (Lambda)  server-side renders at runtime (uses getInitialProps or getServerSideProps)\n09:51:12.844  ○  (Static)  automatically rendered as static HTML (uses no initial props)\n09:51:12.844  ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)\n09:51:12.895  Done in 7.76s.\n09:51:18.943  Traced Next.js serverless functions for external files in: 6031.273ms\n09:51:32.783  Compressed shared serverless function files: 13839.791ms\n09:51:32.947  All serverless functions created in: 162.795ms\n09:51:32.988  Error: The Serverless Function \"api/test-api-alt\" is 51.63mb which exceeds the maximum size limit of 50mb. Learn more: https://zeit.co/docs/v2/platform/limits#serverless-function-size\n09:51:34.613  Done with \"package.json\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambecker%2Fnow-function-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsambecker%2Fnow-function-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambecker%2Fnow-function-size/lists"}