refactor: Use napi-rs/image instead of sharp for screenshots#28586
Merged
refactor: Use napi-rs/image instead of sharp for screenshots#28586
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline Idle baseline with Instance AI module loaded
Memory consumption baseline with starter plan resources
docker-stats
How to read this table
|
Contributor
Author
|
I'll test this a bit now to ensure it works, this didn't get enough testing last week. |
Contributor
|
Works perfectly, thank you @Cadiac 🚀 |
Contributor
Author
|
Also tested earlier locally that this did in fact did the issue I was seeing on my machine |
dlavrenuek
approved these changes
Apr 21, 2026
Contributor
|
Looks like I clicked on "comment" instead of "approve" last time 🙈 |
Contributor
|
Got released with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npx @n8n/computer-use ...commands failed silently with exit 1 on machines that have a system-widelibvips(e.g. installed via homebrew). Sharp's install script (useGlobalLibvips()insharp/lib/libvips.js) detects a compatible systemlibvipsand prefers to build from source against it - but building requiresnode-gyp, which isn't in sharp's deps. npx swallows the install error, so the user sees no banner, no logs, and no clue what went wrong.I did consider adding
node-gypas a dependency but decided against it as that bundles a full C++ toolchain footprint for what amounts to onetoJpeghelper.@napi-rs/image(MIT) is a pure-Rust image library with statically linked prebuilds per platform. It has no system-library detection path and no build-from-source fallback, so install either succeeds with a prebuilt binary or fails loudly. Prebuild coverage is equivalent to sharp for our use case (desktop tool: macOS arm64/x64, Windows x64/arm64, Linux x64/arm64 glibc+musl). Admittedly I have no experience from using this library before, butnapi-rsecosystem seems reasonably actively developed.Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)