Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #24490
Closed
Open
Issue created Oct 21, 2017 by Administrator@rootContributor

ServiceWorker registration failed

Created by: ghost

When running npm run docs, the following happens:

  1. bundle exec jekyll build: generates the documentation files.
  2. node build/workbox.js: which, in turn, performs the following: 2.1 Obtains the location of the workbox-sw module currently installed in node_modules. 2.2 Copy the main file obtained in 2.1 to gh_pages/assets/js/vendor. With the current version of workbox-sw, the path to the copied file would look like this: gh_pages/assets/js/vendor/workbox-sw.prod.v2.1.0.js. 2.3 Read the file sw.js in the repository root, replace the {fileName} pattern with the file name copied in 2.2 (workbox-sw.prod.v2.1.0.js) and save it in the gh_pages root.

Then, when running the documentation server, the index.html page includes <script src="/assets/js/src/pwa.js">. And this script invokes, in turn, the file sw.js created in point 2.3.

So far everything would be OK, but there is a problem when running the test server using `npm run docs-serve'. As Jekyll's documentation mentions (see https://jekyllrb.com/docs/usage/): Destination folders are cleaned on site builds. Then, when executing "npm run docs-serve", when the documentation files are rebuilt, all the work done in point 2 is lost. And, for this reason, the service worker stops working, throwing errors in console.

Error in Windows shell: error-sw-shell

Error in Firefox console: error-sw-console

I am now working on proposing a solution for this. I have to find a way for docs-serve script not to overwrite or delete files generated during docs-compile and postdocs-compile scripts.

Assignee
Assign to
Time tracking