nuxt-community / universal-storage-module

Universal Storage Utilities for Nuxt 2
MIT License
276 stars 15 forks source link

Default options are not overwritten in v0.5.7 #171

Closed rxsto closed 3 years ago

rxsto commented 3 years ago

I've just upgraded @nuxtjs/universal-storage to 0.5.7 and it seemingly stopped working. I didn't get to actual debugging but I can definitely tell that the new version is not overwriting the default options. I didn't change any configuration and downgrading to 0.5.6 fixed the issue for me.

I'm on nuxt 2.14.12. This is my configuration in nuxt.config.js:

storage: {
    vuex: {
      namespace: 'storage'
    },
    localStorage: {
      prefix: 'k_'
    },
    cookie: false,
    ignoreExceptions: false
  }

Looking forward to a fix! ~ Cheers

Atinux commented 3 years ago

Do you mind checking this @farzadso ?

nathanchase commented 3 years ago

Same on 0.5.6 for me. Doesn't work on 0.5.6 or 0.5.7.

This doesn't work:

storage: {
    cookie: 'myappname.',
    localStorage: 'myappname.',
  },

Neither does this work:

storage: {
    cookie: {
      prefix: 'myappname.',
    },
    localStorage: {
      prefix: 'myappname.',
    },
  },

Everything just gets put in storage without a prefix, no matter what I define in nuxt.config.js.

Atinux commented 3 years ago

It would be nice to create a small reproduction with CodeSandBox to quickly look at your issue.

nathanchase commented 3 years ago

It would be nice to create a small reproduction with CodeSandBox to quickly look at your issue.

Go to https://d23gm.sse.codesandbox.io/, inspect in DevTools, and go to Application tab. You'll see the stored value "testParam" has no prefix as defined in nuxt.config.js (should be myappname.testParam).

image

rxsto commented 3 years ago

Hey there, just wanted to check out the progress on this 😊

As it seems there's a PR open with a fix for this issue: https://github.com/nuxt-community/universal-storage-module/pull/168

Is there anything else needed as of now? ~ Cheers

farzadso commented 3 years ago

Sorry for the delay. I haven't been in the open-source community for quite some time but I'm back. I left a comment on the PR. Please check it.

rxsto commented 3 years ago

Hey there, I'm sadly not able to track down this issue time-wise at the moment. I'd appreciate someone else having a look.

~ Cheers

farzadso commented 3 years ago

This should be fixed in v0.5.8.

rxsto commented 3 years ago

Thanks Farzad, very much appreciated!

Could this be published to npm? I'd love to upgrade my production sites to the new fixed version 😊

~ Cheers

farzadso commented 3 years ago

@rxsto Sorry for the inconvenience. It should be published now.

rxsto commented 3 years ago

Thanks again Farzad, but the build seemingly went wrong since there aren't any source files in the 0.5.8 release on npm.

It's basically just empty: https://i.imgur.com/LqOUaqO.png

farzadso commented 3 years ago

Should be fixed in v0.5.9.

rxsto commented 3 years ago

Thank you very much Farzad! I can confirm that the release is functional and the fix is working as well!

Have a great day, ~ Cheers

farzadso commented 3 years ago

@rxsto Good to hear. Sorry for all the ups and downs.