-
Notifications
You must be signed in to change notification settings - Fork 822
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
importScripts using Workbox + workbox-build
can lead to broken SW
#1324
Comments
Here's the relevant template that workbox/packages/workbox-build/src/templates/sw-template.js Lines 30 to 36 in 505122f
The way I'm interpreting this issue is that there needs to be some way of segregating the This might be doable by searching through the Or we might want to encourage a model in which you could disable the automatic I'm inclined to go for the first approach, unless anyone else has any ideas. How does that sound, @beatrizdemiguelperez & co.? |
+1 to the seperate of workbox.js and using it that way. |
Great. +1 first option. Thanks! |
@beatrizdemiguelperez pointed this out on the Slack channel.
If you add an
importScript
that uses theworkbox
API andworkbox-build
callsworkbox.setConfig()
, the service worker throws withworkbox-sw.js:1 Uncaught Error: Config must be set before accessing workbox.* modules
to account for the fact that this is probably not intended.@jeffposnick the easiest solution is to call setConfig before importing additional scripts.
The text was updated successfully, but these errors were encountered: