jimp
jimp copied to clipboard
Do you support vite?
Expected Behavior
jimp.read should not be undefined
Current Behavior
jimp.read is undefined
Failure Information (for bugs)
import Jimp from 'jimp'; console.log(Jimp.read) // undefined
Steps to Reproduce
Screenshots
Context
- Jimp Version: "^0.22.8",
- Operating System: window 10
- Node version: v18.16.0
Failure Logs
Is it possible to use Jimp with vite?
Is it possible to use Jimp with vite?
I don't think so.
are you use in web browser? you can try : import "jimp/browser/lib/jimp.js"; console.log(Jimp.read)
:rocket: Issue was released in v1.0.2
:rocket:
@hipstersmoothie How to use in web after release this package?
http://jimp-dev.github.io/jimp/guides/browser/
It doen't work in vite. I tried and use jimp/browser and jimp
Failed to resolve import "jimp/browser"
if use import Jimp from 'jimp'; then i see this error in console.
That stack trace seems odd. Could you share a minimal repro?
So there was a problem with us not shipping the browser files. That's fixed in 1.1.3
.
Lookin into making the bundler experience more automatic
I noticed on prev version of library works
await Jimp.read(ctx.getImageData(0, 0, canvas.width, canvas.height));
but now i see error
what previous version?
"jimp": "0.22.12",
It looks like in v1 you would call fromBitmap
instead of fromBuffer
@hipstersmoothie I updated to 1.2.0 version and use
import Jimp from 'jimp';
but see error
node_modules/.vite/deps/jimp.js?v=84fca0b0' does not provide an export named 'default'
That's cause Jimp has no default export anymore.
import { Jimp } from 'jimp';
A lot of thanks for support
no prob! added to migration guide http://jimp-dev.github.io/jimp/guides/migrate-to-v1/