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

Strategy.js throws uncaught exception "TypeError: this.q is not a function" #2686

Closed
pidtuner opened this issue Dec 2, 2020 · 4 comments
Closed

Comments

@pidtuner
Copy link

pidtuner commented Dec 2, 2020

Library Affected:
workbox-cdn

Browser & Platform:
all browsers

Issue or Feature Request Description:

Using version 6.0.0 in my project https://pidtuner.com. You can check up the bug live right now at the site. Source code in:

https://github.com/pidtuner/pidtuner.github.io

When developing on a local server works fine, but once I upload to production, this bug appears:

image

I also notice that every time I refresh, a new service worker appears to be registered:

image

@jeffposnick
Copy link
Contributor

jeffposnick commented Dec 2, 2020

Thanks for reporting this.

After debugging the https://pidtuner.com site, I think the issue is due to #1674, which... was not resolved prior to the launch of v6. CC: @philipwalton

(I don't see a q property on the PrecacheStrategy instance or the Strategy prototype, which is what workbox-precaching thinks _handle() was minified as.)

Screen Shot 2020-12-02 at 1 19 58 PM

@jeffposnick
Copy link
Contributor

A short-term fix while remaining on v6.0.0 would be to switch to the development builds of Workbox, which doesn't minify the source code (and therefore shouldn't be confused by cross-package symbol minification).

// Place this immediately after your importScripts(...) statement.
workbox.setConfig({ debug: true });

The development builds are the default when serving from localhost, which is why you only see this after deployment.

pidtuner pushed a commit to pidtuner/pidtuner.github.io that referenced this issue Dec 3, 2020
@juangburgos
Copy link

I confirm that the workbox.setConfig({ debug: true }); works, now added to https://pidtuner.com. Will update to production when fixed.

Thanks!

@jeffposnick
Copy link
Contributor

This should be fixed in the 6.0.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants