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

Next 11 Serverless Functions Break - "Request be smaller than 69905067 bytes for the CreateFunction Operation" #454

Closed
NoahBres opened this issue Jun 28, 2021 · 11 comments
Labels
priority: medium type: bug code to address defects in shipped code

Comments

@NoahBres
Copy link

NoahBres commented Jun 28, 2021

Describe the bug
I have a very small serverless function, 114 lines long with 2 relatively small packages, and it kills the netlify deploys after upgrading to Next 11. It was working fine on Next 10.

The function compiles to 63.9kb according to next build.

Screen Shot 2021-06-28 at 4 55 52 PM

However, upon deploy, this function throws the error "Request must be smaller than 69905067 bytes for the CreateFunction operation." This error seems to be related to AWS lambda functions setting a package size limit of 50mb. This function is definitely under that.

Screen Shot 2021-06-28 at 4 58 53 PM

To Reproduce

  1. Implement serverless function
  2. Deploy build

Versions

  • Next.js: 11.0.0

Here is our deploy log if helpful: https://gist.github.com/vishnuSriram/270e0a5a72122a91c1494fd4a6544524

@lindsaylevine lindsaylevine added priority: medium type: bug code to address defects in shipped code labels Jun 29, 2021
@lindsaylevine
Copy link

@NoahBres hey noah! so sorry you're running into this!

do you have esbuild configured in your netlify.toml? (see docs https://docs.netlify.com/configure-builds/file-based-configuration/#functions). this should resolve your problem. let us know if it does!

note: esbuild in its current state breaks dynamic imports in next. if you're using dynamic imports in your site, we have a fix for the broken imports behind a feature flag. to enable it, add NETLIFY_EXPERIMENTAL_PROCESS_DYNAMIC_IMPORTS as an environment variable with the value set to true. if you do set this up and test it out, please let us know too! feedback would be invaluable!!!

@NoahBres
Copy link
Author

NoahBres commented Jun 30, 2021

This worked great! Thank you so much!!

I did not have dynamic imports so can't give any feedback on that. But thank you for this fix!

@tgmarinho
Copy link

@NoahBres hey noah! so sorry you're running into this!

do you have esbuild configured in your netlify.toml? (see docs https://docs.netlify.com/configure-builds/file-based-configuration/#functions). this should resolve your problem. let us know if it does!

note: esbuild in its current state breaks dynamic imports in next. if you're using dynamic imports in your site, we have a fix for the broken imports behind a feature flag. to enable it, add NETLIFY_EXPERIMENTAL_PROCESS_DYNAMIC_IMPORTS as an environment variable with the value set to true. if you do set this up and test it out, please let us know too! feedback would be invaluable!!!

it's working for me also, thanks!

@tgmarinho
Copy link

Complete solution here: #571 (comment)

@Gnarus-G
Copy link

Gnarus-G commented Oct 5, 2021

I am currently wrestling with this issue.

I've applied these configurations as I've read to do.
image

image

image

image

Am I missing something?

P.S. Here is the source code if you need it, https://github.com/Gnarus-G/bytin

@lindsaylevine
Copy link

@Gnarus-G just to confirm - you're getting the "request must be smaller than.." error?

@Gnarus-G
Copy link

Gnarus-G commented Oct 6, 2021

@lindsaylevine Yes I am.

@lindsaylevine
Copy link

@Gnarus-G gotcha, okay. would you be willing to give our plugin rewrite alpha a try? it's not ready for production, but i predict it will fix your issue. a formal beta will be released at the end of this week. to try, install https://www.npmjs.com/package/@netlify/plugin-nextjs-experimental and follow the instructions there. let us know!

@Gnarus-G
Copy link

Gnarus-G commented Oct 7, 2021

@lindsaylevine Still getting the issue.
image
image

@lindsaylevine
Copy link

i think you can remove esbuild and external_node_modules (not sure about all but you definitely shouldnt need next in there). i'd give that a try.

@Gnarus-G
Copy link

Gnarus-G commented Oct 7, 2021

@lindsaylevine Thanks very much for your help.

I removed esbuild and external_node_modules configs, and it finally deployed. I'm happy about that.
But now there's an
image
on my /api route which should show a Graphiql interface.

But I don't care anymore, my production is working fine on vercel so I'm good. You can ignore me now.

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

4 participants