unstorage icon indicating copy to clipboard operation
unstorage copied to clipboard

`getItems` does not work with `prefixStorage`

Open harlan-zw opened this issue 4 months ago • 3 comments

Environment

1.10.1

Reproduction

https://stackblitz.com/edit/stackblitz-starters-rrstqp?file=index.js

Describe the bug

Working

useStorage().getItems(['namespace:key'])

Not Working

prefixStorage(useStorage(), 'namespace').getItems(['key'])
useStorage('namespace').getItems(['key'])

// { key: "key", value: null }

It seems to switch back to the default driver (memory). I'm guessing this is because the mount is being discovered from the input key, without the base being applied first.

Additional context

No response

Logs

No response

harlan-zw avatar Feb 07 '24 13:02 harlan-zw

Can you please make a sandbox ideally with unstorage only? 🙏🏼

pi0 avatar Feb 07 '24 14:02 pi0

Yes, sorry thought it was clear enough. Here is a repro: https://stackblitz.com/edit/stackblitz-starters-rrstqp?file=index.js

Would be great to add a starter to readme for quickly spinning one up.

harlan-zw avatar Feb 07 '24 15:02 harlan-zw

useStorage('namespace').clear() also not working with namespace

dimasxp avatar Apr 09 '24 04:04 dimasxp