TRAC-1161: fix - Set request locale in generateMetadata before data fetch#3112
Open
jairo-bc wants to merge 2 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 1fd56c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
…etch generateMetadata runs before the page body and fetches page data via cache()-memoized loaders without first calling setRequestLocale. During ISR regeneration there is no request, so next-intl getServerLocale() returns undefined, the storefront client omits Accept-Language, and BigCommerce serves default-locale content that poisons the memoized cache for the whole render. Call setRequestLocale(locale) before the fetch in each generateMetadata. Fixes TRAC-1161
jairo-bc
force-pushed
the
jairopanduro/ltrac-1220-product-translations-fall-back-to-default-after-revalidation
branch
from
July 16, 2026 18:22
488be3a to
c57f282
Compare
Contributor
Bundle Size ReportComparing against baseline from No bundle size changes detected. |
Contributor
Unlighthouse Performance Comparison — VercelComparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores. Summary ScoreAggregate score across all categories as reported by Unlighthouse.
Category Scores
Core Web Vitals
|
jairo-bc
marked this pull request as ready for review
July 16, 2026 19:17
parthshahp
approved these changes
Jul 17, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 17, 2026
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.
Jira: TRAC-1161
What/Why?
generateMetadatafetches data viacache()-memoized loaders beforesetRequestLocale.getServerLocale()→undefined→ client omitsAccept-Language→ default-locale content is fetched and poisons the memoized cache for the whole render.setRequestLocale(locale)before the fetch in eachgenerateMetadata— matches next-intl's static-rendering requirement.Testing
tsc --noEmitclean for edited files.next dev): set smallDEFAULT_REVALIDATE_TARGET,build && start, load a non-default-locale page, wait past revalidate, reload twice → content stays translated (before fix: flips to default).