sst / open-next

Open source Next.js serverless adapter
https://open-next.js.org
MIT License
3.7k stars 111 forks source link

Fix image optimization support for Next 14.1.1 #377

Closed chungweileong94 closed 4 months ago

chungweileong94 commented 4 months ago

fix #374

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: 98db0fc20f1515d9d10bfc598359ecff4c810ee6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages | Name | Type | | ---------------- | ----- | | open-next | Patch | | app-pages-router | Patch | | app-router | Patch | | tests-unit | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
open-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2024 2:02pm
conico974 commented 4 months ago

@chungweileong94 Did you have any issues with sharp version ? Like this one https://github.com/sst/open-next/issues/373

If this is not a problem anymore for 14.1.1, we could set sharp version to 0.32.2 for next 14.1.1+ and to 0.32.6 for below

chungweileong94 commented 4 months ago

@chungweileong94 Did you have any issues with sharp version ? Like this one https://github.com/sst/open-next/issues/373

Yes, but with different issue, and I have to downgrade to 0.32.6. I will try to verify it the issue that you mentioned.

chungweileong94 commented 4 months ago

@conico974 Just tested sharp@0.33.2 with next@14.1.1, the problem still exists.

conico974 commented 4 months ago

@conico974 Just tested sharp@0.33.2 with next@14.1.1, the problem still exists.

Could you change sharp version here to 0.32.6 ? https://github.com/sst/open-next/blob/3deb2022d0bb506e4c4b66baeae248c7c2b153e5/packages/open-next/src/build.ts#L370 I'll try to merge and release tomorrow when i'll get some time to test things

chungweileong94 commented 4 months ago

Could you change sharp version here to 0.32.6 ?

No problem, it is done.

khuezy commented 4 months ago

Thanks @chungweileong94 !! Can we add an e2e test to fetch an image and check that the response's Content-Type is image/webp? You can pick any (appropriate image) from unsplash, or save this image and add it to the public folder: https://twitter.com/thdxr/status/1738582905511669896/photo/1

khuezy commented 4 months ago

Thanks so much @chungweileong94 !