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
I just started using this library today but I can't get it to work. The only thing that has worked for me so far is using ?lqip. I've installed webp-loader, lqip-loader and imagemin-mozjpeg but everytime after conversion, the files just look like this:
import React from "react";
export default function Test(props) {
return (
<div>
<img src={require('public/images/picture.jpg?webp')} />
</div>
);
}
My _next/static/images/ folder looks like this when firing up the server with npm run dev:
picture-[hash1].jpg (non-optimized original image)
picture-[hash2].jpg
picture-[hash2].jpg.webp (both with the same hash2)
picture-[hash1].jpg is the regular picture, but both picture-[hash2].jpg and picture-[hash2].jpg.webp don't have image data and show this when I open them with a text editor:
Of course, it won't show because it's just text. Somehow images aren't being converted. Do I need to install anything else that I might have skipped over?
Note the optimizeImagesInDev is set to true, but it will do the same if it's set to false, and it will also do the same in production.
Thank you!
The text was updated successfully, but these errors were encountered:
I just started using this library today but I can't get it to work. The only thing that has worked for me so far is using
?lqip
. I've installed webp-loader, lqip-loader and imagemin-mozjpeg but everytime after conversion, the files just look like this:package.json
My next.config.js:
My code:
My
_next/static/images/
folder looks like this when firing up the server withnpm run dev
:picture-[hash1].jpg
is the regular picture, but bothpicture-[hash2].jpg
andpicture-[hash2].jpg.webp
don't have image data and show this when I open them with a text editor:When inspecting the img element with DevTools I can see that it's referencing the [hash2] webp image:
Of course, it won't show because it's just text. Somehow images aren't being converted. Do I need to install anything else that I might have skipped over?
Note the optimizeImagesInDev is set to true, but it will do the same if it's set to false, and it will also do the same in production.
Thank you!
The text was updated successfully, but these errors were encountered: