-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error .jpg : Expected a string
, got object
#443
Comments
Hm, looks like something wrong with options, because imagemin doesn't validate them |
Investigate |
@alexander-akait you can check my rep for investigation, I tried different options, but the error is always the same. Its clear project with only react, typescript and some loaders, without extra plugins. |
Found a problem, bug in in if (!isSvg(buffer)) {
return buffer;
} But in
So weird, WIP on this |
Okay, looks like new ImageMinimizerPlugin({
minimizer: [
{
implementation: ImageMinimizerPlugin.imageminMinify,
options: {
// Lossless optimization with custom option
// Feel free to experiment with options for better result for you
plugins: [
["gifsicle", { interlaced: true }],
["jpegtran", { progressive: true }],
["optipng", { optimizationLevel: 5 }],
],
},
},
{
implementation: ImageMinimizerPlugin.svgoMinify,
options: {
encodeOptions: {
// Pass over SVGs multiple times to ensure all optimizations are applied. False by default
multipass: true,
plugins: [
{
name: "preset-default",
params: {
overrides: {
removeViewBox: false,
addAttributesToSVGElement: {
params: {
attributes: [{ xmlns: "http://www.w3.org/2000/svg" }],
},
},
},
},
},
],
},
},
},
],
}); There is an issue with |
Please update https://github.com/webpack-contrib/image-minimizer-webpack-plugin/releases/tag/v4.0.2 and use configuration above, feel free to feedback |
@alexander-akait It work now, thx ) |
When i use the image-minimizer-webpack-plugini, get an error
"ERROR in Error with '2149f2eb790fd4afc8f7.jpg': Expected a
string
, gotobject
"Everything works without a plugin. This is a clean project, I did everything according to the documentation
My webpack config
I tried different methods, "asset", "asset/recource", "asset/inline", "asset/source", "file-loader", but the error is always the same.
My test component with image
My package.json
The text was updated successfully, but these errors were encountered: