You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it should read PNG files as it does with the JPEG and others
Current Behavior
I am using customJimp with Vite and whenever I include the JIMP/png package inside my config files JIMP throws an error
Failure Information (for bugs)
Uncaught TypeError: Cannot read properties of undefined (reading 'toString')
at node_modules/browserify-zlib/lib/index.js (chunk-BDYZPAYP.js?v=25465f5d:7645:100)
at __require2 (chunk-R3NO7AUE.js?v=25465f5d:26:50)
at node_modules/pngjs/lib/parser-async.js (chunk-BDYZPAYP.js?v=25465f5d:9212:16)
at __require2 (chunk-R3NO7AUE.js?v=25465f5d:26:50)
at node_modules/pngjs/lib/png.js (chunk-BDYZPAYP.js?v=25465f5d:10164:18)
at __require2 (chunk-R3NO7AUE.js?v=25465f5d:26:50)
at chunk-BDYZPAYP.js?v=25465f5d:10299:28
node_modules/browserify-zlib/lib/index.js @ chunk-BDYZPAYP.js?v=25465f5d:7645
__require2 @ chunk-R3NO7AUE.js?v=25465f5d:26
node_modules/pngjs/lib/parser-async.js @ chunk-BDYZPAYP.js?v=25465f5d:9212
__require2 @ chunk-R3NO7AUE.js?v=25465f5d:26
node_modules/pngjs/lib/png.js @ chunk-BDYZPAYP.js?v=25465f5d:10164
__require2 @ chunk-R3NO7AUE.js?v=25465f5d:26
(anonymous) @ chunk-BDYZPAYP.js?v=25465f5d:10299
Steps to Reproduce
nothing particulate.
create config and import it.
everything is ok until I import PNG as a type
import bmp from "@jimp/bmp";
import configure from "@jimp/custom";
import gif from "@jimp/gif";
import jpeg from "@jimp/jpeg";
import blur from "@jimp/plugin-blur";
import color from "@jimp/plugin-color";
import contain from "@jimp/plugin-contain";
import normalize from "@jimp/plugin-normalize";
import resize from "@jimp/plugin-resize";
import png from "@jimp/png";
import tiff from "@jimp/tiff";
export default configure({
types: [jpeg, png, bmp, gif, tiff],
plugins: [resize, blur, color, contain, normalize],
});
Context
vite.config
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import inject from '@rollup/plugin-inject'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
inject({
modules: { Buffer: ['buffer', 'Buffer'] }
}),
nodePolyfills()
]
})
Expected Behavior
it should read PNG files as it does with the JPEG and others
Current Behavior
I am using customJimp with Vite and whenever I include the JIMP/png package inside my config files JIMP throws an error
Failure Information (for bugs)
Steps to Reproduce
nothing particulate.
create config and import it.
everything is ok until I import PNG as a type
Context
vite.config
package.json
Failure Logs
The text was updated successfully, but these errors were encountered: