Promise returned by `useStorageAsync` never resolves
The example from the docs of useStorageAsync does not actually work because the returned Promise does never resolve:
// Use top-level await if your environment supports it
const accessToken = await useStorageAsync('access.token', '', SomeAsyncStorage)
console.log(accessToken.value) // "the real value stored in storage"
See full reproducer example in playground.
The returned Promise is meant to resolve with the data after the first/initial read: https://github.com/vueuse/vueuse/blob/8ff6f1948b68aab4e840de24678a38452d1e0c2d/packages/core/useStorageAsync/index.ts#L104-L109
The issue here is though, that data - having a then and catch method is a Promise itself: https://github.com/vueuse/vueuse/blob/8ff6f1948b68aab4e840de24678a38452d1e0c2d/packages/core/useStorageAsync/index.ts#L136-L139
So calling resolve(data) does not resolve with the value data but instead first tries to resolve data as a Promise - which circularly depends on itself...
Source: vueuse/vueuse