Search code examples
progressive-web-appsservice-workerworkbox

Workbox 6: ReferenceError: swDest is not defined


Getting ReferenceError: swDest is not defined when trying to run Workbox 6.

In my sw_build.js file I have that I call with node sw_build.js in my package.json file...

enter image description here

In the console I see this as the output:

enter image description here

It appears as though the files get created?, I just don't understand why I'm getting the odd error.

enter image description here


Solution

  • Your swDest reference is in line 16, and swDest is not defined. That's why the file is created but error occurs. I think you copied the example code without modification on this line.