I failed building my lambda-functions boilerplate site due to a problematic node sharp package which uses a libvips binary. Webpack doesn’t know how to bundle it!
As it is a sharp recurrent issue, I think someone as already been able to resolve my issue.
I tried a lot of different googled solutions but none succeeded.
I do not use a local building…
Part of the build log:
7:17:36 AM: WARNING in ../node_modules/sharp/build/Release/sharp.node 1:0
7:17:36 AM: Module parse failed: Unexpected character '' (1:0)
7:17:36 AM: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
7:17:36 AM: (Source code omitted for this binary file)
7:17:36 AM: @ ../node_modules/sharp/lib/constructor.js 11:2-40
7:17:36 AM: @ ../node_modules/sharp/lib/index.js
7:17:36 AM: @ ./init.js
Our advice for all build errors is get the build working locally. That’ll be your first step in troubleshooting, so get that configured and let us know if it works any better! I doubt it will, but then you can tell us for instance what files exist in your build when it fails, so we can potentially better advise you.
This article is a good place to start overall on build debugging, and you’ll notice that step one is get builds working locally as Netlify is not magic and won’t fix code errors for you