Plugin "netlify-plugin-checklinks" failed │sw.js not found


I’m not very familiar with Netlify and Gatsby, so this question is probably a rookie question.

My deploy fails. The site works fine locally. Netlify tries to load a file called sw.js. This file does not exist. I’m working based on netlify-templates/gatsby-starter-netlify-cms. In this template no such file exists, too. What should I do?

9:21:35 PM:   ✖ FAIL load public/sw.js
9:21:35 PM:   | operator: load
9:21:35 PM:   | expected: 200 public/sw.js
9:21:35 PM:   |   actual: ENOENT: no such file or directory, open '/opt/build/repo/public/sw.js'
9:21:35 PM:   |       at: public/app-40b43a0a5abddc2280c4.js:1:15624
9:21:35 PM:   139 tests
9:21:35 PM:   138 passed
9:21:35 PM:     1 failed
9:21:36 PM: ​
9:21:36 PM: ┌───────────────────────────────────────────┐
9:21:36 PM: │ Plugin "netlify-plugin-checklinks" failed │
9:21:36 PM: └───────────────────────────────────────────┘

hiya, so this plugin is doing its job exactly as instructed! It’s failing your build process because the sw.js file isn’t available for some reason.

sw.js seems to be a service worker:

So maybe you can unregister it? Not 100% sure - this isn’t necessarily my area of strongest expertise.

I do know that if you removed that build plugin, your build should complete, so, that’s another option. But it would be preferable to understand what sw.js is and where it is being linked from, if its needed, etc.

Thanks a lot for you answer, perry.

I figured out that deinstalling the “Checklinks” plugin by munter has helped. This is now fixed.

1 Like