Giter Club home page Giter Club logo

Comments (6)

raphaeldevs avatar raphaeldevs commented on June 24, 2024 2

You can install this package: @types/workbox-window. Then, you should create a folder named @types and a file named workbox.d.ts with the following content:

import { Workbox } from 'workbox-window';

declare global {
  interface Window {
    workbox: Workbox
  }
}

It's works for me:
image

from next-pwa.

mostafa-rio avatar mostafa-rio commented on June 24, 2024

Could you please describe the context of the code that you're getting this error from?

from next-pwa.

mugavri avatar mugavri commented on June 24, 2024

lifecycle events

https://github.com/shadowwalker/next-pwa/blob/master/examples/lifecycle/pages/index.js

from next-pwa.

busybox11 avatar busybox11 commented on June 24, 2024

image

Also getting this TypeScript error. Just set it up on my NextJS project with next-pwa, window.workbox does not have any type definition

from next-pwa.

LyghtCode avatar LyghtCode commented on June 24, 2024

Im still getting the same error in the ts-config and i did what you had suggested @raphaeldevs

from next-pwa.

raphaeldevs avatar raphaeldevs commented on June 24, 2024

Can you show the error? @LyghtCode

from next-pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.