Upgrading to V2 (pwa - localforage)



  • Hello
    I have a pwa in the quasar 1.x branch and am trying to upgrade to quasar 2.x. I will comment on the problems I had:

    1. Following the update guide [1] I could never finish, in the end I had problems with workbox, so I discarded this option and went for the next one.

    2. I started an app from scratch and I was moving the code and modifies it according to the guide [1] and installing the dependencies. This worked fine, the app runs, but I have a problem with the storage. Below I comment what happens.

    • I use VuexPersistence and localForage for persistent storage. The problem I have is that the data is lost when refreshing or closing and re-entering.

    This worked fine before updating:

    import VuexPersistence from 'vuex-persist'
    import localForage from 'localforage'
    
    Vue.use(Vuex)
    const vuexLocal = new VuexPersistence({
      storage: localForage,
      key: 'my_pwa_app'
    })
    
    export default function () {
      const Store = new Vuex.Store({
        plugins: [vuexLocal.plugin],
        modules: {
        ...
    

    but as I said, the data is lost.
    I thought it might be something relative to the localForage or VuexPersistence versions, because having created the project from scratch and installed the dependencies again, they were updated with respect to the original project, but it was not that

    • If I change the storage to window.localStorage it works fine:
    Vue.use(Vuex)
    const vuexLocal = new VuexPersistence({
      storage: window.localStorage,
      key: 'my_pwa_app'
    })
    

    Anyone have any idea what might be going on
    Thank you so much
    Jose

    [1] https://quasar.dev/quasar-cli/app-upgrade-guide



  • I have the same issue … any help plz ?


Log in to reply