小编Pav*_*sko的帖子

带有工作箱的服务工作者 - 未捕获的语法错误:意外的标记“<”..跳过等待

我已经用 CRA 创建了 React 应用程序。我想要定制软件。我正在使用workbox-build 和injectManifest 来创建我的SW。但我仍然坚持等待激活 =/ 和 Uncaught SyntaxError: Unexpected token '<'。或者..

如果我使用 sw-template2.js .. 我可以跳过等待.. 但我仍然收到 Uncaught SyntaxError: Unexpected token '<' 和白页,我需要手动刷新页面才能查看内容。有什么建议如何使用该软件顺利更新我的页面吗?

我的registerServiceWorker.js:

// In production, we register a service worker to serve assets from local cache.

// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs service-worker workbox

5
推荐指数
0
解决办法
1148
查看次数

标签 统计

javascript ×1

reactjs ×1

service-worker ×1

workbox ×1