I
I
Ilya Matviychuk2020-09-09 21:09:11
caching
Ilya Matviychuk, 2020-09-09 21:09:11

Why is pwabuilder's service worker not connecting?

I even created a clean site

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel='manifest' href='/manifest.json'>
    <script type="module">
        import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';

const el = document.createElement('pwa-update');
document.body.appendChild(el);
    </script>
    
</head>
<body>
testtest
</body>


But, as in all previous works, the error
Uncaught ReferenceError: importScripts is not defined at pwabuilder-sw.js:1


First 6 lines of pwabuilder-sw.js:
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.0.0/workbox-sw.js');

const CACHE = "pwabuilder-page";

// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
const offlineFallbackPage = "ToDo-replace-this-name.html";


what pwabuilder says:
5f5919d70079c489561356.png
what lighthouse says:
5f591a36bb68b135213696.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor P., 2020-09-17
@Jeer

Hello, I don’t really understand when I made a service worker, I worked with this guide
https://habr.com/ru/company/mailru/blog/450504/
Then on another project, on Angular, I just did npm-install, everything is there at once took off

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question