-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimized images not found because theyre not in root #78
Comments
Hi @kevincarld, Could you please explain the use case of "./" instead of "/" to me? Can you share an example of how you are using the ExportedImage component? |
Hi @Niels-IO , actually I think I just have the same issue as the other comments. Because the static site im exporting won't be in the root directory that's why image src's are having issue |
Can this be reopened? My images are not found after proper export: Code:
It seems like the path should be under |
Actually, the name is wrong: |
Hi @Rashair, After you run the command "build:docker", you should see a folder called nextImageExportOptimizer inside the .export folder. (I confirmed with the example app in this module that this is correctly working). Then the URL in the browser would resolve as the images are stored in the nextImageExportOptimizer folder, which is indeed at the root level. The random hash is actually created by next.js as you have used statically imported images, and this is how they handle it. As the srcset uses the images with the added hash and the images in the folder nextImageExportOptimizer are named accordingly, everything matches. Where are the optimized images placed if you run the build:docker command? |
There only under 'images' - nowhere else. The nextImageExportOptimizer folder does not appear. I've also tried on your example app and it works locally for me there, but not in my own app :/ |
I think the issue is with the statically imported images - other seem to work |
Hi @Rashair, I am currently a little bit clueless about how to help you further. Could you create a minimal example that reproduces the error? |
I think I found the issue - I have a custom |
Hi @Rashair, Thank you very much! This is indeed the issue, and I found an easy fix. I will release it in the next patch version. |
Hi,
Im using next export and the images are not found, How do I make it such that the beginning path of images has "./" instead of "/".
Thanks
The text was updated successfully, but these errors were encountered: