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

Request must be smaller than 69905067 bytes for the CreateFunction operation #297

Closed
vitorcamachoo opened this issue May 12, 2021 · 3 comments
Labels
priority: medium type: bug code to address defects in shipped code

Comments

@vitorcamachoo
Copy link

vitorcamachoo commented May 12, 2021

Describe the bug
At my company, we're doing some testing, trying to migrate from Vercel to Netlify. We're using Nextjs applications under NX workspace management. The thing is, when trying to deploy our application, I'm getting the following error and I don't know how to fix that.

Request must be smaller than 69905067 bytes for the CreateFunction operation

I've followed this article to help me deploying nx workspace to Netlify, but so far without success.
https://www.netlify.com/blog/2020/04/21/deploying-nx-monorepos-to-netlify/

Configurations

Build command: npx nx build web-app --prod --output-path=./

Versions

  • Next.js: 10.1.3

If you're using the CLI to build

  • OS: macOS

If you're using file-based installation

  • netlify.toml:
[[plugins]]
 package = "./tools/plugins/netlify/stop-build"

Deploy Logs

12:31:30 PM: Build ready to start
12:31:32 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
12:31:32 PM: build-image tag: v3.7.6
12:31:32 PM: buildbot version: 34236c89c5e0f57e9641df89ea45ad498b21db8c
12:31:32 PM: Fetching cached dependencies
12:31:32 PM: Starting to download cache of 758.0MB
12:31:41 PM: Finished downloading cache in 9.147380285s
12:31:41 PM: Starting to extract cache
12:32:09 PM: Finished extracting cache in 27.445986565s
12:32:09 PM: Finished fetching cache in 36.821980084s
12:32:09 PM: Starting to prepare the repo for build
12:32:10 PM: Preparing Git Reference refs/heads/feature/migrate-to-netlify
12:32:11 PM: Parsing package.json dependencies
12:32:12 PM: Starting build script
12:32:12 PM: Installing dependencies
12:32:12 PM: Python version set to 2.7
12:32:13 PM: Started restoring cached node version
12:32:15 PM: Finished restoring cached node version
12:32:15 PM: Attempting node version 'v15.5.0' from .nvmrc
12:32:16 PM: v15.5.0 is already installed.
12:32:17 PM: Now using node v15.5.0 (npm v7.3.0)
12:32:17 PM: Started restoring cached build plugins
12:32:17 PM: Finished restoring cached build plugins
12:32:17 PM: Attempting ruby version 2.7.1, read from environment
12:32:18 PM: Using ruby version 2.7.1
12:32:19 PM: Using PHP version 5.6
12:32:19 PM: Started restoring cached node modules
12:32:19 PM: Finished restoring cached node modules
12:32:19 PM: Started restoring cached go cache
12:32:19 PM: Finished restoring cached go cache
12:32:19 PM: go version go1.14.4 linux/amd64
12:32:19 PM: go version go1.14.4 linux/amd64
12:32:19 PM: Installing missing commands
12:32:19 PM: Verify run directory
12:32:21 PM: ​
12:32:21 PM: ────────────────────────────────────────────────────────────────
12:32:21 PM:   Netlify Build                                                 
12:32:21 PM: ────────────────────────────────────────────────────────────────
12:32:21 PM: ​
12:32:21 PM: ❯ Version
12:32:21 PM:   @netlify/build 11.12.0
12:32:21 PM: ​
12:32:21 PM: ❯ Flags
12:32:21 PM:   deployId: 609bbc92ab7813000893f8fa
12:32:21 PM: ​
12:32:21 PM: ❯ Current directory
12:32:21 PM:   /opt/build/repo
12:32:21 PM: ​
12:32:21 PM: ❯ Config file
12:32:21 PM:   /opt/build/repo/netlify.toml
12:32:21 PM: ​
12:32:21 PM: ❯ Context
12:32:21 PM:   branch-deploy
12:32:21 PM: ​
12:32:21 PM: ❯ Loading plugins
12:32:21 PM:    - @netlify/plugin-nextjs@3.2.2 from Netlify app
12:32:21 PM:    - netlify-plugin-cache-nextjs@1.4.0 from Netlify app
12:32:21 PM:    - ./tools/plugins/netlify/stop-build@3.1.0 from netlify.toml
12:32:21 PM: ​
12:32:21 PM: ────────────────────────────────────────────────────────────────
12:32:21 PM:   1. onPreBuild command from @netlify/plugin-nextjs             
12:32:21 PM: ────────────────────────────────────────────────────────────────
12:32:21 PM: ​
12:32:21 PM: info  - Loaded env from /opt/build/repo/.env
12:32:22 PM: info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
12:32:23 PM: Next.js cache restored.
12:32:23 PM: ​
12:32:23 PM: (@netlify/plugin-nextjs onPreBuild completed in 1.7s)
12:32:23 PM: ​
12:32:23 PM: ────────────────────────────────────────────────────────────────
12:32:23 PM:   2. onPreBuild command from netlify-plugin-cache-nextjs        
12:32:23 PM: ────────────────────────────────────────────────────────────────
12:32:23 PM: ​
12:32:24 PM: Restored the cached .next folder at the location `.next/cache`
12:32:24 PM: ​
12:32:24 PM: (netlify-plugin-cache-nextjs onPreBuild completed in 1.1s)
12:32:24 PM: ​
12:32:24 PM: ─────────────────────────────────────────────────────────────────
12:32:24 PM:   3. onPreBuild command from ./tools/plugins/netlify/stop-build  
12:32:24 PM: ─────────────────────────────────────────────────────────────────
12:32:24 PM: ​
12:32:26 PM: ​
12:32:26 PM: (./tools/plugins/netlify/stop-build onPreBuild completed in 1.6s)
12:32:26 PM: ​
12:32:26 PM: ────────────────────────────────────────────────────────────────
12:32:26 PM:   4. Build command from Netlify app                             
12:32:26 PM: ────────────────────────────────────────────────────────────────
12:32:26 PM: ​
12:32:26 PM: $ npx nx build web-app --prod --output-path=./
12:32:26 PM: > nx run web-app:build:production --outputPath=./
12:32:30 PM: info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
12:32:32 PM: info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
12:32:32 PM: warn  - You have enabled experimental feature(s).
12:32:32 PM: warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
12:32:32 PM: info  - Checking validity of types...
12:32:50 PM: info  - Creating an optimized production build...
12:32:51 PM: info  - Using external babel configuration from /opt/build/repo/babel.config.json
12:32:51 PM: info  - Using external babel configuration from /opt/build/repo/apps/web-app/.babelrc
12:32:53 PM: info  - Using external babel configuration from /opt/build/repo/libs/backoffice/.babelrc
12:35:00 PM: info  - Compiled successfully
12:35:00 PM: info  - Collecting page data...
12:35:13 PM: info  - Generating static pages (0/4)
12:35:25 PM: info  - Generating static pages (1/4)
12:35:25 PM: info  - Generating static pages (2/4)
12:35:25 PM: info  - Generating static pages (3/4)
12:35:26 PM: info  - Generating static pages (4/4)
12:35:26 PM: info  - Finalizing page optimization...
12:35:26 PM: Page                                                           Size     First Load JS
12:35:26 PM: ┌ ● / (ISR: 60000 Seconds)                                     34.1 kB         871 kB
12:35:26 PM: ├   /_app                                                      0 B             837 kB
12:35:26 PM: ├ ○ /404                                                       236 B           837 kB
12:35:26 PM: └ ○ /about                                                     238 B           837 kB
12:35:26 PM: + First Load JS shared by all                                  837 kB
12:35:26 PM:   ├ chunks/3ef630e34cd10ba68f9d468ac363ff81c534e1e9.50b6f0.js  8.79 kB
12:35:26 PM:   ├ chunks/71247caf95475e3ea7f9a0f8a30beb258b23d005.19f0bf.js  106 kB
12:35:26 PM:   ├ chunks/74e7cf71.501343.js                                  30.8 kB
12:35:26 PM:   ├ chunks/90daeab3.b64445.js                                  56.7 kB
12:35:26 PM:   ├ chunks/commons.6413a8.js                                   219 kB
12:35:26 PM:   ├ chunks/framework.d8c1cd.js                                 47.2 kB
12:35:26 PM:   ├ chunks/main.4c00bd.js                                      6.13 kB
12:35:26 PM:   ├ chunks/pages/_app.829afc.js                                360 kB
12:35:26 PM:   ├ chunks/webpack.ab4f31.js                                   2.18 kB
12:35:26 PM:   └ css/86ab3a16845bfd343f71.css                               1.27 kB
12:35:26 PM: λ  (Lambda)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
12:35:26 PM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
12:35:26 PM: ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
12:35:26 PM:    (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
12:35:27 PM: ———————————————————————————————————————————————
12:35:27 PM: >  NX   SUCCESS  Running target "build" succeeded
12:35:27 PM: ​
12:35:27 PM: (build.command completed in 3m 1.4s)
12:35:27 PM: ​
12:35:27 PM: ────────────────────────────────────────────────────────────────
12:35:27 PM:   5. onBuild command from @netlify/plugin-nextjs                
12:35:27 PM: ────────────────────────────────────────────────────────────────
12:35:27 PM: ​
12:35:27 PM: ** Running Next on Netlify package **
12:35:27 PM: 🚀 Next on Netlify 🚀
12:35:27 PM: 🌍️ Copying public/ folder to /opt/build/repo
12:35:27 PM: 💼 Copying static NextJS assets to /opt/build/repo
12:35:27 PM: 💫 Setting up API endpoints as Netlify Functions in netlify/functions
12:35:27 PM: 💫 Setting up pages with getInitialProps as Netlify Functions in netlify/functions
12:35:27 PM: 💫 Setting up pages with getServerSideProps as Netlify Functions in netlify/functions
12:35:27 PM: 🔥 Copying pre-rendered pages with getStaticProps and JSON data to /opt/build/repo
12:35:27 PM: 💫 Setting up pages with getStaticProps and fallback: true as Netlify Functions in netlify/functions
12:35:27 PM: 💫 Setting up pages with getStaticProps and revalidation interval as Netlify Functions in netlify/functions
12:35:27 PM: 💼 Copying dynamic import chunks to netlify/functions/next_index
12:35:27 PM: 🔥 Copying pre-rendered pages without props to /opt/build/repo
12:35:27 PM: 🔀 Setting up redirects
12:35:27 PM: 🔀 Setting up headers
12:35:27 PM: ✅ Success! All done!
12:35:27 PM: ​
12:35:27 PM: (@netlify/plugin-nextjs onBuild completed in 64ms)
12:35:27 PM: ​
12:35:27 PM: ────────────────────────────────────────────────────────────────
12:35:27 PM:   6. Functions bundling                                         
12:35:27 PM: ────────────────────────────────────────────────────────────────
12:35:27 PM: ​
12:35:27 PM: Packaging Functions from netlify/functions directory:
12:35:27 PM:  - next_image.js
12:35:27 PM:  - next_index/next_index.js
12:35:27 PM: ​
12:37:01 PM: ​
12:37:01 PM: (Functions bundling completed in 1m 33.8s)
12:37:01 PM: ​
12:37:01 PM: ────────────────────────────────────────────────────────────────
12:37:01 PM:   7. onPostBuild command from @netlify/plugin-nextjs            
12:37:01 PM: ────────────────────────────────────────────────────────────────
12:37:01 PM: ​
12:37:02 PM: Next.js cache saved.
12:37:02 PM: ​
12:37:02 PM: (@netlify/plugin-nextjs onPostBuild completed in 1.5s)
12:37:02 PM: ​
12:37:02 PM: ────────────────────────────────────────────────────────────────
12:37:02 PM:   8. onPostBuild command from netlify-plugin-cache-nextjs       
12:37:02 PM: ────────────────────────────────────────────────────────────────
12:37:02 PM: ​
12:37:03 PM: Cached the .next folder at the location `.next/cache`
12:37:03 PM: ​
12:37:03 PM: (netlify-plugin-cache-nextjs onPostBuild completed in 181ms)
12:37:03 PM: ​
12:37:03 PM: ────────────────────────────────────────────────────────────────
12:37:03 PM:   9. Deploy site                                                
12:37:03 PM: ────────────────────────────────────────────────────────────────
12:37:03 PM: ​
12:37:03 PM: Starting to deploy site from ''
12:37:05 PM: Creating deploy tree asynchronously
12:37:05 PM: Creating deploy upload records
12:37:08 PM: 16 new files to upload
12:37:08 PM: 1 new functions to upload
12:37:14 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:15 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:17 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:19 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:21 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:25 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:31 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:37 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:47 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:37:55 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:38:21 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:38:44 PM: Request must be smaller than 69905067 bytes for the CreateFunction operation
12:38:44 PM: Failed to upload file: next_index
12:38:44 PM: Site deploy was successfully initiated
12:38:44 PM: ​
12:38:44 PM: (Deploy site completed in 1m 41.3s)
12:38:44 PM: ​
12:38:44 PM: ────────────────────────────────────────────────────────────────
12:38:44 PM:   Netlify Build Complete                                        
12:38:44 PM: ────────────────────────────────────────────────────────────────
12:38:44 PM: ​
12:38:44 PM: (Netlify Build completed in 6m 23.4s)
12:38:44 PM: Execution cancelled
12:38:44 PM: Error running command: Command was cancelled
12:38:44 PM: Failing build: Failed to build site
12:38:44 PM: Finished processing build request in 7m12.416465183s
@lindsaylevine lindsaylevine added priority: medium type: bug code to address defects in shipped code monorepo labels May 12, 2021
@lindsaylevine
Copy link

hey @vitorcamachoo - sorry you're running into this! can you try opting into esbuild? this should generate a much smaller function for you.

add to your netlify.toml:

[functions]
  node_bundler = "esbuild"

more info here: https://docs.netlify.com/configure-builds/file-based-configuration/#functions and https://www.netlify.com/blog/2021/04/02/modern-faster-netlify-functions/

shoutout to netlify engineer @eduardoboucas for the esbuild work/info ❤️

let us know if this works for you!

@lindsaylevine
Copy link

@vitorcamachoo hey vitor any feedback on this suggestion? :)

@lindsaylevine
Copy link

will close until we can get an answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants