Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we skip process.exit(1) from sharp error try/catch ? #2931

Closed
sytolk opened this issue Oct 13, 2021 · 3 comments
Closed

Can we skip process.exit(1) from sharp error try/catch ? #2931

sytolk opened this issue Oct 13, 2021 · 3 comments

Comments

@sytolk
Copy link

sytolk commented Oct 13, 2021

What are you trying to achieve?

To let the user handle error better this line can be skipped: https://github.com/lovell/sharp/blob/master/lib/sharp.js#L23
I'm using sharp in native Electron app that needs to be running never mind that sharp have installation problems on some platforms like:

na@na-x1 ~/Desktop $ ./tagspaces-linux-x86_64-4.0.1.AppImage 
Tagspaces WS: Something went wrong installing the "sharp" module
Tagspaces WS: libvips-cpp.so.42: cannot open shared object file: No such file or directory
Tagspaces WS: Possible solutions:
Tagspaces WS: - Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
Tagspaces WS: - Install for the current runtime: "npm install --platform=linux --arch=x64 sharp"
Tagspaces WS: - Consult the installation documentation: https://sharp.pixelplumbing.com/install

Have you searched for similar questions?
yes
Are you able to provide a minimal, standalone code sample that demonstrates this question?
yes

@lovell
Copy link
Owner

lovell commented Oct 13, 2021

Yes, we should alter this logic to throw an Error instead (it was only changed recently via commit 6c2e6c5 and I can't remember what the reason for this was, if any).

@sytolk
Copy link
Author

sytolk commented Oct 14, 2021

as temporary fix for this we can use sharp version 0.28.3 it works as expected. Thanks!

Calvin-LL added a commit to Calvin-LL/webpack-image-resize-loader that referenced this issue Oct 14, 2021
@lovell lovell added this to the v0.29.2 milestone Oct 17, 2021
@lovell
Copy link
Owner

lovell commented Oct 21, 2021

v0.29.2 now available with the fix for this.

@lovell lovell closed this as completed Oct 21, 2021
martinj pushed a commit to aptoma/sharp that referenced this issue Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants