Closed ralphvirtucio closed 11 months ago
No immediate guesses. I don't have a readily available vue project. Do you have a minimal repro example for this?
I have stumbled upon this issue as well in a React project. You can view the demo here https://stackblitz.com/edit/vitejs-vite-cqulcz?file=src%2Fcomponents%2FUploader.tsx
So this is actually a vite
issue, and has nothing to do with what framework vite
is building. Googling this error easily finds a whole slew of solutions, likely the best one being just using the vite-plugin-node-polyfills
plugin.
However, I can do one better. pngjs
and jpeg-js
are used to encode the result images, and are both decently sized modules. However, when building a client-side application, they really are not needed, since all browsers already have built-in png and jpeg encoders. So in version 2.1.0, I made these encoders optional, and when building a client-side application, you can require('heic-convert/browser')
to use the browser's built-in encoders and leave pngjs
and jpeg-js
out of your final bundle. See #33 for more if you are curious.
Hi there,
I'd like to report an issue. After installing 'heic-convert' in my Vue project and attempting to import it into my components, I encountered the following error: "Uncaught TypeError: util.inherits is not a function." Could you please provide insights into the cause of this error?