Closed joebentaylor1995 closed 5 months ago
Hi @joebentaylor1995,
Just to be sure: did you change the build script in package.json?
Yes i did (it doesnt have the next export
as next config is suggested to have the export enabled under output: 'export'
)
So, i usually run: npm run build && npm run serve
to view locally the entire build
@joebentaylor1995 Do you only have remote images? Have you created a remoteOptimizedImages.js as detailed in the README?
I just tested the library with the newest Next.js version and the optimized images are generated as expected.
What is the terminal output for the build script?
No, my images are all local.
My terminal output:
It seems that you have no pictures in the "public/images" folder, and not used static import for images. In your posted example above you are using a remote image.
How are you using the ExportedImage component?
Og theres plenty of images in the public folder...
The dummyData images are what im trying to use
DummyData as a const in page.jsx
passed via props
into this:
In your next.config.js you specified "public/images" as the image folder where this library looks for images. Change that to "public/dummydata" or move all your images to the "public/images" folder...
Okay,. will give that a go now, I may have overlooked the folder
I think we can close this now, thanks for the help @Niels-IO
After battling with 10 errors for 3 images in the console log for a couple of hours I realised, that when running
next build && next-image-export-optimizer
and then serving this, the assets folder for the optimised images never gets made or generated.I have the exact same config as the docs, but i looked in the
out
folder and there are no optimised images folder anywhere.Using Next 14.1.0![Screenshot 2024-01-29 at 17 38 40](https://github.com/Niels-IO/next-image-export-optimizer/assets/54585427/255f56e1-dc93-4fe9-9848-7aca21afcc03)