fix(image): match Next.js 16 default image sizes#2704
Open
NathanDrake2406 wants to merge 2 commits into
Open
Conversation
Next.js 16 removed the 16px default, but vinext continued generating and accepting it when imageSizes was unset. This added an unnecessary srcSet candidate and diverged from the pinned Next.js behavior. Use the shared server default for build-time defines and keep the client shim fallback aligned. Explicit imageSizes configurations that include 16px remain supported.
NathanDrake2406
marked this pull request as ready for review
July 25, 2026 06:24
commit: |
Contributor
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
The Next.js 16 default-width change correctly updated generated App Router entries, but this behavior test still encoded the previous list. Align the expectation while preserving the neighboring explicit 16px opt-in coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
images.imageSizesby removing16imageSizesconfigurations containing16supportedWhy
vinext is pinned to Next.js 16.2.7, but still used the pre-v16 default:
Next.js 16 removed
16because it is rarely requested and adds an unnecessarycandidate to responsive
srcsetoutput. The mismatch also meant vinext's imageoptimizer accepted a default width that Next.js 16 no longer accepts.
Behavior
w=16images.imageSizescontaining16Validation
vp test run tests/image-component.test.ts tests/shims.test.tsvp check packages/vinext/src/config/next-config.ts packages/vinext/src/index.ts packages/vinext/src/server/image-optimization.ts packages/vinext/src/shims/image.tsx tests/image-component.test.ts tests/shims.test.tsnode scripts/check-shim-types.mjsRisk
This is an intentional Next.js 16 compatibility change for projects that rely
on the default image sizes. Projects that still require 16px optimization can
opt back in with
images.imageSizes, matching Next.js's migration guidance.Explicit configurations are otherwise unchanged.
References