serverless-bundle icon indicating copy to clipboard operation
serverless-bundle copied to clipboard

Webpack error for node compiled libraries - support for node-loader

Open iaxentoi opened this issue 3 years ago • 1 comments

We are trying to add a new library (node-cld) to our project, but we are not able to package it as Webpack fails:

ERROR in ../../cld/build/Release/cld.node 1:0 Module parse failed: Unexpected character '�' (1:0) 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 (Source code omitted for this binary file) @ ../../cld/index.js 2:13-48

The library requires a .node module which is not supported by the default webpack configuration that is provided. Is it possible to add the node-loader to the list of supported loaders? Thank you.

iaxentoi avatar Nov 23 '21 09:11 iaxentoi

I needed the same for the node-canvas module, ended up building a lambda layer with that library as suggested in #43.

It would be great to have this built-in though

bros4president avatar Feb 14 '22 14:02 bros4president