I have CLS issue for one of the websites that uses DatoCMS for backend content. It happens on this landing site: https://gostinskaoprema.eu. I know exactly what is the reason for the low CLS score but I can not figure out why it happens on this statically generated landing site?
Maybe somebody from here can help me understand why I get this layout shift issue. The problem is that few of the sections on the landing site are loaded after the blog section on the bottom of the side. This triggers a big layout shift on page load. I donāt understand why this happens since the entire site is SSG. Shouldnāt all the HTML be available in the landing site after it is generated?
I must be missing something regarding Next.js SSG. When I open the generated index.html file, not all HTML content is present. When page loads it looks like Next.js is injecting these missing sections on the page load⦠Shouldnāt the entire HTML be statically generated and available in the index.html site? What am I missing or not understanding here?
I recently migrated a site from twin.macro + emotion to twin.macro + stitches. The site had some weird layout shifts in the testimonial section on the home page and in the headline section of blog posts. Those were similar to yours in nature and I had no clue where they came from. After the migration to stitches they vanished. I didnāt change any styles and conditionals, I just adapted tw styles to spread syntax for stitches.
That left me with the conclusion, that emotion must be doing some weird unpredictable stuff and I donāt like that at all. I also donāt believe from the impression of your site that youād make a mistake on the application level/in your styles that would produce this bug.
So maybe troubleshooting chakra + emotion can resolve your issue?
I think the actual problem is caused in my <BlockRender /> component which is dynamically loading components used in DatoCMS modular content field. I found this conversation on GitHub.
I also had problems with dynamic import components and the solution in that case was not to import them within the function body of another component but at top-level of module.