fix(BUY-59983): add images.remotePatterns allowlist for catalog image hosts#200
Open
BuyWhere wants to merge 1 commit into
Open
fix(BUY-59983): add images.remotePatterns allowlist for catalog image hosts#200BuyWhere wants to merge 1 commit into
BuyWhere wants to merge 1 commit into
Conversation
…image hosts The /_next/image proxy returned HTTP 400 for every external product image because next.config.mjs had no images.remotePatterns allowlist. Add the upstream catalog image hosts the app actually renders via <Image>: picsum.photos (fallback), m.media-amazon.com + ssl-images-amazon (Amazon), cf/s.shopee.sg + *.shopee.sg (Shopee), images.unsplash.com.
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
Fixes #BUY-59983 —
/_next/imageproxy returns HTTP 400 for every product image, breaking all product cards.Root cause
next.config.mjshad noimages.remotePatternsallowlist. Every<Image>component rendering an external product image URL was rejected by the/_next/imageoptimizer, returning HTTP 400. Confirmed live:Fix
Add
images.remotePatternsfor every upstream catalog image host the app actually renders:picsum.photos— fallback/placeholder images (USPriceComparison, USProductDetail, ProductComparison, us-products)m.media-amazon.com,images-na.ssl-images-amazon.com— Amazon product catalog (trending-products.json)cf.shopee.sg,s.shopee.sg,**.shopee.sg— Shopee catalog CDNimages.unsplash.com— stock imagery on landing/heroVerification
next.config.mjsparses vianode --input-type=moduleimport: 7 remotePatterns loaded.domains/remotePatternsexisted onmainprior to this change.Note on prior work
Earlier heartbeat runs reported a fix as commit
a8627c1d2("Fix Next image proxy host allowlist"), but that commit does not exist in this repo (verifiedgit cat-file+ full history search) andremotePatternswas never present on any branch. This PR is the actual source fix.Deployment
After merge, requires a production redeploy of the Next.js frontend for the new config to take effect (Railway).