Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handlerDidError callback parameter is not exported #2876

Closed
ivandotv opened this issue Jun 23, 2021 · 2 comments · Fixed by #2886
Closed

handlerDidError callback parameter is not exported #2876

ivandotv opened this issue Jun 23, 2021 · 2 comments · Fixed by #2886
Labels
Feature Request TypeScript Issues related to our TypeScript annotations. workbox-core

Comments

@ivandotv
Copy link

ivandotv commented Jun 23, 2021

Library Affected:
workbox-precaching

Browser & Platform:
"all browsers".*

Issue or Feature Request Description:
I'm trying to create a custom plugin, and I can't get a hold on on HandlerDidErrorCallbackParam
Other callback params are exported (HandlerWillStartCallbackParam etc..).

export class OfflineFallbackWithLocale implements WorkboxPlugin {

  // @ts-expect-error - HandlerDidErrorCallbackParam is not exported
  async handlerDidError(param: any) {
    //custom logic for offline page
    return this._precacheController.matchPrecache(this._fallbackURL)
  }
}

Although we could do object destructuring immediately

  async handlerDidError({ request }: { request: Request }) {}
@ivandotv ivandotv changed the title Handler callback parameters are not exported handlerDidError callback parameter is not exported Jun 23, 2021
@jeffposnick
Copy link
Contributor

Thanks—that's an oversight which we'll fix in an upcoming release.

@jeffposnick
Copy link
Contributor

The fix is now deployed in a pre-release of Workbox v6.2.0: https://github.com/GoogleChrome/workbox/releases/tag/v6.2.0-alpha.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request TypeScript Issues related to our TypeScript annotations. workbox-core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants