Sharp image processing with Meteor

Hello,

I’m trying to use sharp in the browser, mainly I want to resize images. But after importing it in the component:

import sharp from 'sharp';

I get this error in the browser console.

Uncaught Error: cannot load native .node modules on the client(…)

I went to the index to look how it is loading sharp and its loading a .node file.

Please any help is really appreciated I have been struggling with this for days.

I’m not familiar with sharp, but a quick read through the installation, requirements and use cases indicate this is a server-only (node) package, which will not run on the browser.

1 Like

Sharp runs on server only. It relies on a binary package that is compiled when you install.

Thx for your answers. indeed it was because it is only server side jeje, my fault.