No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [SOLVED] Chrome (but not FF nor Safari) randomly fails PWA update

    Framework
    5
    43
    3609
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dobbel
      dobbel @ssuess last edited by

      @ssuess

      Sounds promising! The code/flow stays the same if using updatefound instead of updated?

      1 Reply Last reply Reply Quote 0
      • ssuess
        ssuess last edited by

        yes everything else is the same. Since the service worker itself is updating the code regardless of what I am doing (updating local version string and clearing localstorage) I can do what I need earlier in the process and reload which works great! So happy to have found this solution it was really a vexing problem (that only showed up in Chrome for some reason)

        dobbel 1 Reply Last reply Reply Quote 0
        • dobbel
          dobbel @ssuess last edited by

          @ssuess

          Hope this ‘workaround’ won’t be trashed in the next Chrome update 😉

          1 Reply Last reply Reply Quote 0
          • ssuess
            ssuess last edited by ssuess

            UGH, I REALLY hate to have to revisit this, but wouldn’t you know it, this fix made all the OTHER browsers break! I ended up having to do this in the end, which really sucks:

             updatefound (registration) { // registration -> a ServiceWorkerRegistration instance
                console.log('New content is downloading.')
                /* eslint-disable no-extra-boolean-cast */
                if (!!window.chrome) {
                  // all my checking and clearing localstorage stuff here for stupid chrome browsers (Chrome, Edge, etc)
                }
              },
              updated (registration) { // registration -> a ServiceWorkerRegistration instance
                console.log('New content is available; please refresh.')
                if (!window.chrome) {
                  // all my checking and clearing localstorage stuff here for non chrome browsers (FF, Safari)
                  }
                }
              },
            
            dobbel 1 Reply Last reply Reply Quote 0
            • dobbel
              dobbel @ssuess last edited by

              @ssuess

              What a mess…

              btw Did you get any response from the Workbox devs about this?

              1 Reply Last reply Reply Quote 0
              • ssuess
                ssuess last edited by

                @dobbel no they were not very helpful at all, other than to say they didn’t know: https://github.com/GoogleChrome/workbox/issues/2652

                dobbel 1 Reply Last reply Reply Quote 0
                • dobbel
                  dobbel @ssuess last edited by

                  @ssuess

                  Here’s someone that unregisters the service worker before reload:

                  https://forum.quasar-framework.org/topic/7175/hook-in-register-service-worker-update-and-display-notification-in-app/3

                  1 Reply Last reply Reply Quote 0
                  • ssuess
                    ssuess last edited by

                    @dobbel thanks I took a look, but for now my workaround seems to be working so I think I will leave it. Still, this is good info and I might try it later, thanks for the heads up!

                    1 Reply Last reply Reply Quote 0
                    • tlloyduk
                      tlloyduk last edited by tlloyduk

                      I’ve suddenly started to get this after upgrading Quasar to latest - wondered if anyone had come up with a reliable solution since the last post ?

                      
                      Operating System - Windows_NT(10.0.19041) - win32/x64                                                                                                          
                      NodeJs - 12.16.1                                                                                                                                               
                                                                                                                                                                                     
                      Global packages                                                                                                                                                
                        NPM - 3.10.6                                                                                                                                                 
                        yarn - 1.22.4                                                                                                                                                
                        @quasar/cli - 1.1.3                                                                                                                                          
                        @quasar/icongenie - Not installed                                                                                                                            
                        cordova - Not installed                                                                                                                                      
                                                                                                                                                                                     
                      Important local packages                                                                                                                                       
                        quasar - 1.15.10 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time                                          
                        @quasar/app - 2.2.4 -- Quasar Framework local CLI                                                                                                            
                        @quasar/extras - 1.10.2 -- Quasar Framework fonts, icons and animations                                                                                      
                        eslint-plugin-quasar - Not installed                                                                                                                         
                        vue - 2.6.12 -- Reactive, component-oriented view layer for modern web interfaces.                                                                           
                        vue-router - 3.2.0 -- Official router for Vue.js 2                                                                                                           
                        vuex - 3.6.0 -- state management for Vue.js                                                                                                                  
                        electron - Not installed                                                                                                                                     
                        electron-packager - Not installed                                                                                                                            
                        electron-builder - Not installed                                                                                                                             
                        @babel/core - 7.13.8 -- Babel compiler core.                                                                                                                 
                        webpack - 4.44.2 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support l
                       stuff.                                                                                                                                                        
                        webpack-dev-server - 3.11.0 -- Serves a webpack app. Updates the browser on changes.                                                                         
                        workbox-webpack-plugin - 6.1.2 -- A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.   
                        register-service-worker - 1.7.1 -- Script for registering service worker, with hooks                                                                         
                        typescript - 4.2.2 -- TypeScript is a language for application scale JavaScript development                                                                  
                        @capacitor/core - Not installed                                                                                                                              
                        @capacitor/cli - Not installed                                                                                                                               
                        @capacitor/android - Not installed                                                                                                                           
                        @capacitor/ios - Not installed                                                                                                                               
                                                                                                                                                                                     
                      Quasar App Extensions                                                                                                                                          
                        @quasar/quasar-app-extension-dotenv - 1.1.0 -- Load .env variables into your quasar project                                                                  ```
                      dobbel 1 Reply Last reply Reply Quote 0
                      • dobbel
                        dobbel @tlloyduk last edited by

                        @tlloyduk

                        I would ask this on the new forum where the Quasar team now gives support.

                        https://github.com/quasarframework/quasar/discussions

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post