I run a static browser-games site. Every page exists twice: once as prerendered HTML for search engines, and once as a React app for people clicking around. The build is a babel bundle plus a generator script. Here are three bugs that went through that build without a single error and broke the page people actually saw.
1. <img width="700" height="700"> means height: 700px
Every game card has an image with width and height attributes. That is the standard advice: the browser reserves the right space before the image loads, so the layout does not jump.
My CSS made the image fill its card and kept it square:
.grid img , .cards img { width : 100% ; aspect-ratio : 1 / 1 ; object-fit : cover ; display : block ; }
Enter fullscreen mode
Exit fullscreen mode
The cards were about 176 px wide, so I expected 176 × 176.
The browser drew 176 × 700 on every category, tag and collection page.…