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
  • Merge requests
  • !24492

Fix ServiceWorker registration failed

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge v4-dev-fix-service-worker into v4-dev Oct 21, 2017
  • Overview 0
  • Commits 3
  • Pipelines 0
  • Changes 2

Created by: ghost

Fixes: #24490 (closed)

I explain what I'm doing here:

  1. I change the destination of 'workbox-sw' from 'assets/js/vendor' to 'assets/js/sw'. The change of destination is because I want to include the folder in 'keep_files' key of '_config.yml'.

  2. I include './sw.js' in the files to exclude during build, since this file only serves as a template (it should not be copied to gh_pages, as it would overwrite the correctly generated file).

Then:

  1. After docs-compile, the workbox files are copied and the manifest is generated in gh_pages.
  2. During docs-serve, Jekyll deletes all files, but keeps the files needed for the service worker.

error-sw-fixed

As the current Bootstrap documentation mentions, npm run docs must be run at least once for the service worker files to be generated.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: v4-dev-fix-service-worker