but I’m facing a Request must be smaller than 69905067 bytes for the CreateFunction operation error.
When I bundle my functions locally using yarn netlify functions:build --src functions, the .zip files produced are nowhere close to the 50mb limit. The largest is 17mb.
Unfortunately I am not able to share the repo.
What’s the proper way to build functions locally? Perhaps the command I am using: yarn netlify functions:build --src functions is not faithful to the way Netlify bundles functions for production?
Below are the file sizes for the bundles generated by the command above.
It’s worth nothing that even if I omit external_node_modules = ["shopify-api-node"] from my netlify.toml the bundles remain the same size.
netlify -v produces the following output: netlify-cli/6.14.1 win32-x64 node-v14.18.1
The bundles found in .netlify/functions after running netlify build are slightly larger, but individually still well below 50mb.
Running netlify deploy --prod produced a successful deploy with the following warning:
» Warning: Modules with native dependencies
»
» - [redacted]
» - [redacted]
»
» The serverless functions above use Node.js modules with native dependencies, which
» must be installed on a system with the same architecture as the function runtime. A
» mismatch in the system and runtime may lead to errors when invoking your functions.
» To ensure your functions work as expected, we recommend using continuous deployment
» instead of manual deployment.
»
» For more information, visit https://ntl.fyi/cli-native-modules.
In fact, the functions are broken when deployed this way.
This is because you’re using Windows, but deploying on Linux servers that AWS uses, I believe.
Well, unfortunately without a reproduction, I can’t confirm this and can’t comment on any possible solutions. While the Request must be smaller than 69905067 bytes for the CreateFunction operation error is common, I’ve never seen it happen for functions that are less than 50 MB in size.
That’s quite bizarre. I have a few functions which use the canvas package and they all deploy successfully.
I imagine there is some leeway allowed on the 50 MB and it’s only when I include the shopify-api-node package that I go over.
I wonder if its something I’m misconfiguring that’s causing the canvas package to bloat the bundle so much.
I know that quite a few users here use the canvas package with Netlify functions and I have seen none of them report this.