Gary Illyes, Google Webmaster Trends Analyst, recommends websites owners to load the content first, including the “marginal boilerplate” content, when their websites are javascript-heavy.
On Mastodon and LinkedIn, he wrote:
Do you have a JavaScript-heavy site and you see lots of dups reported in Search Console? Try to restructure the js calls such that the content (including marginal boilerplate) loads first and see if that helps.
I have a bunch of emails in my inbox where the issue is that the centerpiece took forever to load, so rendering timed out (my most likely explanation) and we were left with a bunch of pages that only had the boilerplate. With only the boilerplate, those pages are dups.