liamfiddler / eleventy-plugin-lazyimages

Eleventy plugin that adds blurry placeholders & lazy loading to your images
MIT License
139 stars 29 forks source link

Segfault on build #46

Closed JbIPS closed 3 years ago

JbIPS commented 3 years ago

Hi, I just try to add this plugin in my Eleventy project but it breaks on build (looks like SVG to blame):

LazyImages - found 3 images in _site/plus/index.html
LazyImages - started processing ./img/logo.svg
LazyImages - started processing ./img/logo-dark.svg
LazyImages - started processing ./img/logo.svg
vips_value_hash: no case for NULL
        type 64, gchararray
        generic 55, GParamString
vips_value_hash: no case for 0.000000
        type 60, gdouble
        generic 109, GParamDouble
vips_value_hash: no case for FALSE
        type 20, gboolean
        generic 79, GParamBoolean
vips_value_hash: no case for ((VipsAccess) VIPS_ACCESS_RANDOM)
        type 81933184, VipsAccess
        generic 81, GParamEnum
vips_value_hash: no case for FALSE
        type 20, gboolean
        generic 79, GParamBoolean
[1]    20095 segmentation fault (core dumped)  npm start

I'm not sure what I can tweak to get it to work (I didn't see any option that could help) so any lead would be welcome :smiley:.

Thank you

liamfiddler commented 3 years ago

👋 Hi @JbIPS !

I haven't seen that error before, but based on the message I'm confident it's coming from Sharp (the library this plugin uses to process images).

A similar issue is reported on this Gatsby repo which also uses Sharp https://github.com/gatsbyjs/gatsby/issues/29041

I'd suggest having a look at that issue, and maybe also at the issues for Sharp to see if anyone else has resolved this.

JbIPS commented 3 years ago

Hi @liamfiddler,

I tried the "native" image plugin and got a similar error. Since it's also based on Sharp, I agree with you and I'll look over there to find a solution.

Thank you

weiji14 commented 2 years ago

In case anyone stumbles on this, I managed to prevent the segfault by manually pinning sharp to v0.30.3 in my package.json file (instead of letting npm install the latest sharp=0.31.1 version). This was using @11ty/eleventy=1.0.2 and eleventy-plugin-lazyimages=2.1.2.