11ty / eleventy-img

Utility to perform build-time image transformations.

Home Page:https://www.11ty.dev/docs/plugins/image/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run eleventy due to undefined symbol: vips_fail_on_get_type

insanity54 opened this issue · comments

I wanted to try eleventy-img but I'm unable to use it due to an error.

NODE_ENV=development yarn eleventy --serve --config=./.eleventy.cjs
yarn run v1.22.19
$ /home/chris/Documents/futureporn/node_modules/.bin/eleventy --serve --config=./.eleventy.cjs
/home/chris/.nvm/versions/node/v18.12.1/bin/node: symbol lookup error: /home/chris/Documents/futureporn/node_modules/@11ty/eleventy-img/node_modules/sharp/build/Release/sharp-linux-x64.node: undefined symbol: vips_fail_on_get_type
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Things I have tried

Node v16.19.0. I deleted node_modules and ran yarn followed by yarn eleventy. Same error.

Node v18.12.1. I deleted node_modules and ran yarn followed by yarn eleventy. Same error.

I ran yarn add sharp@latest and tried to run yarn eleventy again. I tried this with both Node versions I mentioned. Same error.

I ran yarn upgrade and tried to run yarn eleventy again. Same error.

I do think sharp requires libvips! I haven’t encountered too many folks running into this, which makes me wonder where it’s managed (I don’t believe it’s installed automatically via npm with sharp)

https://www.libvips.org/install.html

Would love some guidance about your setup (OS, version)

Thanks, I wasn't aware I needed libvips. Ubuntu 22.04.1 LTS

I installed system packages libvips42, libvips-dev, and libvips-tools.

I no longer see the vips_fail_on_get_type error. Now I get a Segmentation Fault.

NODE_ENV=development yarn eleventy --serve --config=./.eleventy.cjs
yarn run v1.22.19
$ /home/chris/Documents/futureporn/node_modules/.bin/eleventy --serve --config=./.eleventy.cjs
Segmentation fault (core dumped)
error Command failed with exit code 139.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Seems intermittent. Same call different times gives different errors.

chris@zed-zed:~/Documents/futureporn$ /home/chris/Documents/futureporn/node_modules/.bin/eleventy --serve --config=./.eleventy.cjs
corrupted size vs. prev_size
Aborted (core dumped)
chris@zed-zed:~/Documents/futureporn$ /home/chris/Documents/futureporn/node_modules/.bin/eleventy --serve --config=./.eleventy.cjs
munmap_chunk(): invalid pointer
Aborted (core dumped)
chris@zed-zed:~/Documents/futureporn$ 

I have suspected hardware issues on this computer for awhile. I have to reboot it daily or the whole thing will lock up. That could be the cause.

I might have to revisit this issue when I can find a different computer to test on.

I ended up trying some more things on the same computer. I was able to get past the error by installing both libvips and sharp from source with npm, not yarn.

vips-8.13.3
sharp 0.31.3

npm install --ignore-scripts=false --verbose --build-from-source --legacy-peer-deps sharp

EDIT: More trial and error. I was seeing the vips_fail_on_get_type error on not only my local machine, but also my remote build server (Fleek) so I had to dig into this issue a little more.

I tried docker image node:16 and node:16-alpine and saw the error on both.

Turns out eleventy-img was causing the issue. It has a dependency on sharp@^0.30.4, while eleventy-img needs sharp@^0.30.7

I removed eleventy-favicon to work around the issue.