我收到错误!对于 Google Chrome Lighthouse 报告中的“性能”选项卡。我尝试修复但无法修复,有什么建议吗?
这是以下错误:
Largest Contentful Paint Error! The page did not display content that qualifies as a Largest Contentful Paint (LCP). Ensure the page has a valid LCP element and then try again. (NO_LCP)
在诊断上,它有一个错误:
Preconnect to required origins Error! Consider adding preconnect or dns-prefetch resource hints to establish early connections to important third-party origins. Learn how to preconnect to required origins.FCPLCP. https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/?utm_source=lighthouse&utm_medium=devtools
[在此输入图像描述]( https://i.stack.imgur.com/dbZoA.png )
我将以下链接标记添加到我的 app.js 文件中,但它没有修复错误。我将其添加到预连接到谷歌字体,尽管我使用的是 NextJS 的 next/font。资源https://nextjs.org/docs/messages/google-font-preconnect
<link rel="preconnect" …
performance lighthouse next.js preconnect largest-contentful-paint