Closed siamahnaf closed 1 year ago
Hi, could you please provide a minimal code example that I could use to reproduce the issue? Do you experience the issue with a local production build too (next build && next start
) or only when deployed?
Do you have some specific images that behave unexpectedly? I would like to have a look at them to make sure we can properly detect the necessary information when optimizing them.
Hello, Actually I am getting issue when I deploy this to the server. I am not getting the issue when I run my project in local. It only occurred on the server.
**Note, after 10 days investigation, I can understand some images come with WebP format and some images come without WebP format. Specially, those image that are uploaded via dashboard after deploying the site. Here I can see that, If I build my project again with npm run build
and then I deploy the latest build, Here I can see the new images come with optimization, which image are not come with optimization in previous build.
I have some questions-
Here is my server spec-
Azure Virtual Machine- OS- ubuntu Type- 22_04-lts-gen2 Memory- 3.5 GB Storage- 20GB
**In local I use windows 11 with 12 GB Ram and Core i5, 7 gen prossor as I say that in local image optimization works perfectly.
** I have not some specific images that behave unexpectedly. Actually, it changes by every load. I can see different different image on every load.
@balazsorban44, any update please?
Hello @balazsorban44, any updatw please...
@balazsorban44, why you are not replying to me.
@balazsorban44, please response me, please.
@balazsorban44, this is githup code repository- https://github.com/nekmart/nekmart
@balazsorban44, I give my guthub repository.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Operating System: Platform: win32 Arch: x64 Version: Windows 10 Pro Binaries: Node: 16.17.0 npm: N/A Yarn: N/A pnpm: N/A Relevant packages: next: 12.2.6 eslint-config-next: 12.3.1 react: 18.2.0 react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Here the bug is very critical. I create one project and I deploy this project to vercel. Here I get all images are optimized. When I upload new image from my dashboard, it also optimized this image.
But I need to deploy my project to aws ec2 linux server. That's why I choose nextjs
output tracing features
. That's I build a standlone mode by helping of this documentation- https://nextjs.org/docs/advanced-features/output-file-tracing#automatically-copying-traced-filesAfter building, When I start my server by running
node server.js
. It starts successfully. Everything is okay. I can see all image optimized withwebp
format. But after some time by reloading my page, I can see image optimization not working. Then I can see some images come with optimization and some images come without optimization. Some images come with webp format, and some images come with jpeg, png format. After deploying to aws ec2. When I load my page first time, I can see all images are optmized. But after reloading my page or after some time the image optimization not working.Also, When I upload new image from my dashboard, that new image isn't come with optimizations.
***Note: In terminal I not finding any
sharp
related error. Actually, I am not Geeting any error in my terminal.I also try next js latest version-
12.3.1
and12.3.2-canary.22
Here is my
next.config.js
-In my package.json-
I use
next/image
component in this way in my project.<Image src={process.env.NEXT_PUBLIC_IMAGE_PATH + brand.image} width={25} height={25} alt={brand.name} />
Expected Behavior
All images should come with webp format! Even all new images after building my app uploading from dashboard. My Next js project is fully SSR. Now I need all the images will be optimized even Api called images uploading from dashboard. It needs optimized. Please help me. How can I solve this problem.
Link to reproduction
https://www.nekmart.com
To Reproduce
Here is my link-
Standalone mode link- https://www.nekmart.com/ Vercel link- https://nekmart.vercel.app/
I need to work image optimization in standalone mode perfectly.