如何修复控制台警告“资源......已使用链接预加载预加载,但在窗口加载事件的几秒钟内未使用”?

Dav*_*ost 5 javascript reactjs progressive-web-apps gatsby

我正在为 PWA 开发 gatsby 主题/启动器,但我似乎无法摆脱以下控制台警告:

The resource https://davidde.github.io/gatsby-starter-simpwa/page-data/offline-plugin-app-shell-fallback/page-data.json
was preloaded using link preload but not used within a few seconds from the window's load event.
Please make sure it has an appropriate `as` value and it is preloaded intentionally.
Run Code Online (Sandbox Code Playgroud)

首次加载时一切正常;服务工作者像它应该的那样注册并且没有警告。但是,重新加载后,会出现此警告。这是没有意义的,因为该as值被设置为 'fetch'。我假设它有事情做与配置gatsby-plugin-offline或可能gatsby-plugin-manifest

源代码位于https://github.com/davidde/gatsby-starter-simpwa
并部署到https://davidde.github.io/gatsby-starter-simpwa/

有谁知道是什么原因造成的?

Moh*_*Ali -1

在React应用程序的公共文件夹中,这是一个index.html,将此行粘贴到index.html中,然后再次尝试运行React应用程序

<link rel="preload" href="fonts/cicle_fina-webfont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
Run Code Online (Sandbox Code Playgroud)