-
Notifications
You must be signed in to change notification settings - Fork 35
Native modules support #69
Comments
Right now its BYO native modules. E.g. if you want to use headless chrome in a function you need to include the precompiled binary as a dependancy. There are some projects in the broader ecosystem that are working to solve this binary issue. One is called "yumda" described here https://www.serverlesschats.com/19 There are a couple of ways users can include precompiled binaries:
|
Thanks for this response. So this means at the moment Now I have tried myself on a Netlify Site to use a Function file using |
Users with native modules that don't just work via default It is not ideal. This is why the Functions revamp is needed and will happen one day ™ |
Yes it's a major limitation. Having native modules somewhere in the dependencies tree is quite common in production apps. |
It looks native modules are in fact supported by It seems like building native modules against other Linuxes might work when run on Amazon Linux. However |
Note: this issue is being reported in #79 as well. |
@ehmicky I don't think there's anything more that zip-it-and-ship-it specifically can do about native module support right now. Since #433, it returns a list of any native modules it finds, so that CLI can warn users when deploying locally. Do you think we can close this one, or do you have anything else in mind? |
👍 |
Native modules must be built and run on the same OS. Our build system runs on Linux and so do our AWS Lambda functions. However there are several posts that describe a bigger setup to get any native modules working on AWS Lambda. Do we support native modules on Netlify Functions?
Also they must also be built and run on the same Node.js version. Otherwise they show some error message when run. Our build system uses the
NODE_VERSION
environment variable or.nvmrc
file, with a default of Node10.*.*
. However our AWS Lambda functions use theAWS_LAMBDA_JS_RUNTIME
environment variable, with a default of Node8.10.0
. Note that Node.js version is not relevant when using N-API but not all native modules are using this yet.The text was updated successfully, but these errors were encountered: