question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: The Serverless Function "index" is 52.75mb which exceeds the maximum size limit of 50mb.

See original GitHub issue

Pushing to vercel fails with the error message:

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

My nuxt application is a simple application, uses apollo to query a strapi api.

I added a vercel.json file as mentioned here: https://nuxtjs.org/deployments/vercel/#ssr-with-vercel Looks like this:

{
  "version": 2,
  "builds": [
    {
      "src": "nuxt.config.js",
      "use": "@nuxtjs/vercel-builder",
      "config": {}
    }
  ]
}

I have a .vercelignore file as well:

README.md
.nuxt
node_modules
*.log
.git
.vscode
.vercel
.vercel_cache

I contacted to vercel support, they said the problem is in vercel-builder.

I’m trying to achieve a server side rendered nuxt.

In case you need the full build log from vercel:

Cloning bitbucket.org/.../... (Branch: main, Commit: 9bc04d6)
--
13:05:53.626 | Cloning completed: 2.117s
13:05:53.667 | Analyzing source code...
13:05:53.703 | Warning: Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
13:05:53.874 | Installing build runtime...
13:05:58.768 | Build runtime installed: 4.893s
13:05:59.199 | Looking up build cache...
13:05:59.334 | Build Cache not found
13:05:59.587 | [log] Running with @nuxt/vercel-builder version 0.22.1
13:05:59.587 | [log]  ----------------- Prepare build -----------------
13:05:59.587 | [log] Downloading files...
13:05:59.588 | [log] Working directory: /vercel/path0
13:05:59.612 | [log] Using yarn
13:05:59.612 | [info] Prepare build took: 25.358124 ms
13:05:59.613 | [log]  ----------------- Install devDependencies -----------------
13:05:59.951 | yarn install v1.22.17
13:06:00.061 | [1/5] Resolving packages...
13:06:00.976 | [2/5] Fetching packages...
13:06:33.849 | [3/5] Linking dependencies...
13:06:33.854 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo@0.22.2" has unmet peer dependency "@vue/cli-shared-utils@^3.0.0 \|\| ^4.0.0-0".
13:06:33.854 | warning " > apollo-cache-inmemory@1.6.6" has incorrect peer dependency "graphql@^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0 \|\| ^15.0.0".
13:06:33.857 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > ts-node@8.10.2" has unmet peer dependency "typescript@>=2.7".
13:06:33.863 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface@2.0.2" has incorrect peer dependency "graphql@^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:06:33.866 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface > @apollographql/graphql-language-service-parser@2.0.2" has incorrect peer dependency "graphql@^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:06:33.867 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface > @apollographql/graphql-language-service-types@2.0.2" has incorrect peer dependency "graphql@^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:06:33.869 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface > @apollographql/graphql-language-service-utils@2.0.2" has incorrect peer dependency "graphql@^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:06:33.875 | warning "@nuxtjs/markdownit > raw-loader@4.0.2" has unmet peer dependency "webpack@^4.0.0 \|\| ^5.0.0".
13:06:33.876 | warning "nuxt > @nuxt/components@2.2.1" has unmet peer dependency "consola@*".
13:06:33.883 | warning "@nuxt/postcss8 > css-loader@5.2.7" has unmet peer dependency "webpack@^4.27.0 \|\| ^5.0.0".
13:06:33.884 | warning "@nuxt/postcss8 > postcss-loader@4.3.0" has unmet peer dependency "webpack@^4.0.0 \|\| ^5.0.0".
13:06:33.885 | warning " > @tailwindcss/typography@0.4.1" has unmet peer dependency "tailwindcss@>=2.0.0".
13:06:33.886 | warning " > sass-loader@10.2.1" has unmet peer dependency "webpack@^4.36.0 \|\| ^5.0.0".
13:06:53.833 | [4/5] Building fresh packages...
13:06:57.908 | warning Error running install script for optional dependency: "/vercel/path0/node_modules/sharp: Command failed.
13:06:57.909 | Exit code: 1
13:06:57.909 | Command: (node install/libvips && node install/dll-copy && prebuild-install) \|\| (node install/can-compile && node-gyp rebuild && node install/dll-copy)
13:06:57.909 | Arguments:
13:06:57.909 | Directory: /vercel/path0/node_modules/sharp
13:06:57.909 | Output:
13:06:57.909 | sharp: Using cached /vercel/.npm/_libvips/libvips-8.12.2-linux-x64.tar.br
13:06:57.909 | sharp: Integrity check passed for linux-x64
13:06:57.909 | /bin/sh: prebuild-install: command not found
13:06:57.909 | gyp info it worked if it ends with ok
13:06:57.909 | gyp info using node-gyp@5.1.0
13:06:57.909 | gyp info using node@14.19.0 \| linux \| x64
13:06:57.909 | gyp info find Python using Python version 2.7.18 found at \"/usr/bin/python\"
13:06:57.909 | gyp http GET https://nodejs.org/download/release/v14.19.0/node-v14.19.0-headers.tar.gz
13:06:57.909 | gyp http 200 https://nodejs.org/download/release/v14.19.0/node-v14.19.0-headers.tar.gz
13:06:57.910 | gyp http GET https://nodejs.org/download/release/v14.19.0/SHASUMS256.txt
13:06:57.910 | gyp http 200 https://nodejs.org/download/release/v14.19.0/SHASUMS256.txt
13:06:57.910 | gyp info spawn /usr/bin/python
13:06:57.910 | gyp info spawn args [
13:06:57.910 | gyp info spawn args   '/node14/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
13:06:57.910 | gyp info spawn args   'binding.gyp',
13:06:57.910 | gyp info spawn args   '-f',
13:06:57.910 | gyp info spawn args   'make',
13:06:57.910 | gyp info spawn args   '-I',
13:06:57.910 | gyp info spawn args   '/vercel/path0/node_modules_dev/sharp/build/config.gypi',
13:06:57.910 | gyp info spawn args   '-I',
13:06:57.910 | gyp info spawn args   '/node14/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
13:06:57.910 | gyp info spawn args   '-I',
13:06:57.910 | gyp info spawn args   '/vercel/.cache/node-gyp/14.19.0/include/node/common.gypi',
13:06:57.911 | gyp info spawn args   '-Dlibrary=shared_library',
13:06:57.911 | gyp info spawn args   '-Dvisibility=default',
13:06:57.911 | gyp info spawn args   '-Dnode_root_dir=/vercel/.cache/node-gyp/14.19.0',
13:06:57.911 | gyp info spawn args   '-Dnode_gyp_dir=/node14/lib/node_modules/npm/node_modules/node-gyp',
13:06:57.911 | gyp info spawn args   '-Dnode_lib_file=/vercel/.cache/node-gyp/14.19.0/<(target_arch)/node.lib',
13:06:57.911 | gyp info spawn args   '-Dmodule_root_dir=/vercel/path0/node_modules_dev/sharp',
13:06:57.911 | gyp info spawn args   '-Dnode_engine=v8',
13:06:57.911 | gyp info spawn args   '--depth=.',
13:06:57.911 | gyp info spawn args   '--no-parallel',
13:06:57.911 | gyp info spawn args   '--generator-output',
13:06:57.911 | gyp info spawn args   'build',
13:06:57.911 | gyp info spawn args   '-Goutput_dir=.'
13:06:57.911 | gyp info spawn args ]
13:06:57.911 | gyp info spawn make
13:06:57.911 | gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
13:06:57.912 | make: Entering directory `/vercel/path0/node_modules_dev/sharp/build'
13:06:57.912 | CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
13:06:57.912 | AR(target) Release/obj.target/../node-addon-api/nothing.a
13:06:57.912 | COPY Release/nothing.a
13:06:57.912 | TOUCH Release/obj.target/libvips-cpp.stamp
13:06:57.912 | CXX(target) Release/obj.target/sharp-linux-x64/src/common.o
13:06:57.912 | ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
13:06:57.912 | #include <vips/vips8>
13:06:57.912 | ^~~~~~~~~~~~
13:06:57.912 | compilation terminated.
13:06:57.912 | make: *** [Release/obj.target/sharp-linux-x64/src/common.o] Error 1
13:06:57.912 | make: Leaving directory `/vercel/path0/node_modules_dev/sharp/build'
13:06:57.912 | gyp ERR! build error
13:06:57.912 | gyp ERR! stack Error: `make` failed with exit code: 2
13:06:57.912 | gyp ERR! stack     at ChildProcess.onExit (/node14/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
13:06:57.913 | gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
13:06:57.913 | gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
13:06:57.913 | gyp ERR! System Linux 4.14.262-200.489.amzn2.x86_64
13:06:57.913 | gyp ERR! command \"/node14/bin/node\" \"/node14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
13:06:57.913 | gyp ERR! cwd /vercel/path0/node_modules_dev/sharp
13:06:57.913 | gyp ERR! node -v v14.19.0
13:06:57.913 | gyp ERR! node-gyp -v v5.1.0
13:06:57.913 | gyp ERR! not ok"
13:06:57.913 | info This module is OPTIONAL, you can safely ignore this error
13:06:58.364 | [5/5] Cleaning modules...
13:07:05.233 | Done in 65.29s.
13:07:05.267 | [info] Install devDependencies took: 65653.387341 ms
13:07:05.267 | [log]  ----------------- Nuxt build -----------------
13:07:05.574 | [log] Running nuxt build --standalone --no-lock --config-file "nuxt.config.js" /vercel/path0
13:07:34.200 | [info] Nuxt build took: 28932.58681 ms
13:07:34.200 | [log]  ----------------- Install dependencies -----------------
13:07:34.529 | yarn install v1.22.17
13:07:34.636 | [1/5] Resolving packages...
13:07:36.128 | [2/5] Fetching packages...
13:07:36.520 | [3/5] Linking dependencies...
13:07:36.522 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo@0.22.2" has unmet peer dependency "@vue/cli-shared-utils@^3.0.0 \|\| ^4.0.0-0".
13:07:36.523 | warning " > apollo-cache-inmemory@1.6.6" has incorrect peer dependency "graphql@^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0 \|\| ^15.0.0".
13:07:36.527 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > ts-node@8.10.2" has unmet peer dependency "typescript@>=2.7".
13:07:36.534 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface@2.0.2" has incorrect peer dependency "graphql@^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:07:36.537 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface > @apollographql/graphql-language-service-parser@2.0.2" has incorrect peer dependency "graphql@^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:07:36.538 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface > @apollographql/graphql-language-service-types@2.0.2" has incorrect peer dependency "graphql@^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:07:36.538 | warning "@nuxtjs/apollo > vue-cli-plugin-apollo > apollo > apollo-language-server > @apollographql/graphql-language-service-interface > @apollographql/graphql-language-service-utils@2.0.2" has incorrect peer dependency "graphql@^0.12.0 \|\| ^0.13.0 \|\| ^14.0.0".
13:07:36.542 | warning "@nuxtjs/markdownit > raw-loader@4.0.2" has unmet peer dependency "webpack@^4.0.0 \|\| ^5.0.0".
13:07:49.179 | [4/5] Building fresh packages...
13:07:52.014 | warning Error running install script for optional dependency: "/vercel/path0/node_modules/sharp: Command failed.
13:07:52.014 | Exit code: 1
13:07:52.014 | Command: (node install/libvips && node install/dll-copy && prebuild-install) \|\| (node install/can-compile && node-gyp rebuild && node install/dll-copy)
13:07:52.015 | Arguments:
13:07:52.015 | Directory: /vercel/path0/node_modules/sharp
13:07:52.015 | Output:
13:07:52.015 | sharp: Using cached /vercel/.npm/_libvips/libvips-8.12.2-linux-x64.tar.br
13:07:52.015 | sharp: Integrity check passed for linux-x64
13:07:52.015 | /bin/sh: prebuild-install: command not found
13:07:52.015 | gyp info it worked if it ends with ok
13:07:52.015 | gyp info using node-gyp@5.1.0
13:07:52.015 | gyp info using node@14.19.0 \| linux \| x64
13:07:52.016 | gyp info find Python using Python version 2.7.18 found at \"/usr/bin/python\"
13:07:52.016 | gyp info spawn /usr/bin/python
13:07:52.016 | gyp info spawn args [
13:07:52.016 | gyp info spawn args   '/node14/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
13:07:52.016 | gyp info spawn args   'binding.gyp',
13:07:52.016 | gyp info spawn args   '-f',
13:07:52.016 | gyp info spawn args   'make',
13:07:52.016 | gyp info spawn args   '-I',
13:07:52.017 | gyp info spawn args   '/vercel/path0/node_modules_prod/sharp/build/config.gypi',
13:07:52.017 | gyp info spawn args   '-I',
13:07:52.017 | gyp info spawn args   '/node14/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
13:07:52.017 | gyp info spawn args   '-I',
13:07:52.017 | gyp info spawn args   '/vercel/.cache/node-gyp/14.19.0/include/node/common.gypi',
13:07:52.017 | gyp info spawn args   '-Dlibrary=shared_library',
13:07:52.018 | gyp info spawn args   '-Dvisibility=default',
13:07:52.018 | gyp info spawn args   '-Dnode_root_dir=/vercel/.cache/node-gyp/14.19.0',
13:07:52.018 | gyp info spawn args   '-Dnode_gyp_dir=/node14/lib/node_modules/npm/node_modules/node-gyp',
13:07:52.018 | gyp info spawn args   '-Dnode_lib_file=/vercel/.cache/node-gyp/14.19.0/<(target_arch)/node.lib',
13:07:52.018 | gyp info spawn args   '-Dmodule_root_dir=/vercel/path0/node_modules_prod/sharp',
13:07:52.018 | gyp info spawn args   '-Dnode_engine=v8',
13:07:52.018 | gyp info spawn args   '--depth=.',
13:07:52.018 | gyp info spawn args   '--no-parallel',
13:07:52.019 | gyp info spawn args   '--generator-output',
13:07:52.019 | gyp info spawn args   'build',
13:07:52.019 | gyp info spawn args   '-Goutput_dir=.'
13:07:52.019 | gyp info spawn args ]
13:07:52.019 | gyp info spawn make
13:07:52.019 | gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
13:07:52.020 | make: Entering directory `/vercel/path0/node_modules_prod/sharp/build'
13:07:52.020 | CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
13:07:52.020 | AR(target) Release/obj.target/../node-addon-api/nothing.a
13:07:52.020 | COPY Release/nothing.a
13:07:52.020 | TOUCH Release/obj.target/libvips-cpp.stamp
13:07:52.020 | CXX(target) Release/obj.target/sharp-linux-x64/src/common.o
13:07:52.020 | ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
13:07:52.020 | #include <vips/vips8>
13:07:52.021 | ^~~~~~~~~~~~
13:07:52.021 | compilation terminated.
13:07:52.021 | make: *** [Release/obj.target/sharp-linux-x64/src/common.o] Error 1
13:07:52.021 | make: Leaving directory `/vercel/path0/node_modules_prod/sharp/build'
13:07:52.021 | gyp ERR! build error
13:07:52.021 | gyp ERR! stack Error: `make` failed with exit code: 2
13:07:52.021 | gyp ERR! stack     at ChildProcess.onExit (/node14/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
13:07:52.021 | gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
13:07:52.021 | gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
13:07:52.021 | gyp ERR! System Linux 4.14.262-200.489.amzn2.x86_64
13:07:52.021 | gyp ERR! command \"/node14/bin/node\" \"/node14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
13:07:52.021 | gyp ERR! cwd /vercel/path0/node_modules_prod/sharp
13:07:52.021 | gyp ERR! node -v v14.19.0
13:07:52.022 | gyp ERR! node-gyp -v v5.1.0
13:07:52.022 | gyp ERR! not ok"
13:07:52.022 | info This module is OPTIONAL, you can safely ignore this error
13:07:52.384 | [5/5] Cleaning modules...
13:07:56.835 | Done in 22.31s.
13:07:56.869 | [info] Install dependencies took: 22668.935972 ms
13:07:56.869 | [log]  ----------------- Collect artifacts -----------------
13:08:29.826 | [info] Collect artifacts took: 32955.680385 ms
13:08:29.993 | Failed to process build result for "index". Data: {"type":"Lambda","zipBufferLength":55311368}.
13:08:29.996 | Error: The Serverless Function "index" is 52.75mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

2reactions
turnstylerjcommented, Oct 21, 2022

This is an issue for us trying to deploy a tiny demo Nuxt app with a single component, only the following in dependencies:

  "dependencies": {
    "@nuxtjs/vercel-builder": "^0.23.0",
    "nuxt": "^2.15.8",
    "vue": "^2.7.10",
    "vue-server-renderer": "^2.7.10",
    "vue-template-compiler": "^2.7.10"
  },
Error: The Serverless Function "index" is 60.51mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size

Not sure how we’re expected to build a real application of any substance and deploy it with SSR?

1reaction
matteodemcommented, May 18, 2022

This blogpost provided the solution for our project: https://dev.to/patzick/why-dependencies-matter-deploy-your-nuxt-ssr-universal-app-to-vercel-now-4ndp

Would be nice if the vercel docs explained this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · nuxt/vercel-builder - GitHub
Error: The Serverless Function "index" is 52.75mb which exceeds the maximum size limit of 50mb.
Read more >
vscode output exceeds the size limit. - You.com
VSCode interactive python output exceeds size limit ... Error: The Serverless Function "index" is 52.75mb which exceeds the maximum size limit of 50mb....
Read more >
Error: The Serverless Function "index" is 52.75mb ... - bytemeta
Pushing to vercel fails with the error message: Error: The Serverless Function "index" is 52.75mb which exceeds the maximum size limit of 50mb....
Read more >
Nuxt Vercel-Builder Issues - IssueHint
Error: The Serverless Function "index" is 52.75mb which exceeds the maximum size limit of 50mb. open, 6, 2022-03-09, 2022-12-23.
Read more >
Kraken X60: alert threshold option broken or unsupported by the ...
Error: The Serverless Function "index" is 52.75mb which exceeds the maximum size limit of 50mb. 4, 2022-03-09, 2022-08-12.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found