5 Jan 2025

Cannot find name 'ServiceWorkerGlobalScope' in serwist

Inside tsconfig.json

// before
{
  "compilerOptions": {
    "lib": [
      // ... other libs
    ],
  },
  // other settings
  "exclude": [
    // other paths
  ]
}

// now
{
  "compilerOptions": {
    "lib": [
       "webworker"
    ],
    "types": [
      "@serwist/next/typings"
    ]
  },
  "exclude": [
    "public/sw.js"
  ]
}

We need to add below things:

  1. webworker in lib
  2. inside compilerOptions add types array and inside types add @serwist/next/typings
  3. inside exclude add public/sw.js

You may also like

Introduction to Object-Oriented Programming (OOP) in Python

This blog provides a comprehensive introduction to Object-Oriented P...

Continue reading

Creating an accessible website using HTML and CSS

This guide provides web developers with an overview of how to create...

Continue reading

Extracting Data with Beautiful Soup from HTML and XML

Beautiful Soup is a Python library that can be used for extracting d...

Continue reading