Workbox: Uncaught TypeError: workbox.expiration.Plugin is not a constructor

Created on 16 Feb 2020  路  2Comments  路  Source: GoogleChrome/workbox

Welcome! Please use this template for reporting bugs or requesting features. For questions about using Workbox, the best place to ask is Stack Overflow, tagged with [workbox]: https://stackoverflow.com/questions/ask?tags=workbox

Library Affected:
workbox-build

Browser & Platform:
Mobile Chrome

Issue or Feature Request Description:
Expiration plugin not working as expected on mobile chrome

Uncaught TypeError: workbox.expiration.Plugin is not a constructor

After upgrading to v5.0.0 recently, the error started occurring on mobile chrome.

Most helpful comment

All plugin classes were renamed in the v5. This was mentioned in the breaking changes section of the v5 release notes: https://github.com/GoogleChrome/workbox/releases/tag/v5.0.0

In your case you can change your code from workbox.expiration.Plugin to workbox.expiration.ExpirationPlugin, and it should work.

All 2 comments

All plugin classes were renamed in the v5. This was mentioned in the breaking changes section of the v5 release notes: https://github.com/GoogleChrome/workbox/releases/tag/v5.0.0

In your case you can change your code from workbox.expiration.Plugin to workbox.expiration.ExpirationPlugin, and it should work.

All plugin classes were renamed in the v5. This was mentioned in the breaking changes section of the v5 release notes: https://github.com/GoogleChrome/workbox/releases/tag/v5.0.0

In your case you can change your code from workbox.expiration.Plugin to workbox.expiration.ExpirationPlugin, and it should work.

thank you so muchhhhh

Was this page helpful?
0 / 5 - 0 ratings