Skip to content

storeToRefs() cannot be used with async store setup #2989

Closed as not planned
Closed as not planned
@n0099

Description

@n0099

Reproduction

https://play.pinia.vuejs.org/#eNqNVMFuGjEQ/RVrLxCFtYNoqUQhoq1ySA9tleS4l2V3ICbrsWV7CRXi3ztrw2ZDS8XNnnnz3vPYnl3yxRi+qSGZJFNXWGk8c+Brw6ocV7Ms8S5LbjOUymjr2Y7VDh69tsD2bGm1Yj0uCl2jB8u963WArkE96QdYuhZrJMq89znDDAuNroEhJWddcP+o0L+6ynAqoimyQBsPylS5B9oxNl3U3mtk86KSxQtZxetr8nqPhQUFSOSBfT8VEUhFU9FhSAZJNJuq3PC100g92DXM2SFBR5+wEGli1KRmnyXP3hs3EaIokcpKqOTGcgQv0CgxJ5iw1BCpIC21mo/4Rz4ci1I6341zcCpdWP3qqHNrUhp0dAQFN2BTC1iCBXup7knZO+2T3Hn9cElRUYT1eWgQLWHjta5cmht5qdFuzXzMx3woKrkQJCQk+dv+1ZG0BHUJ+xE6v+HDD/xTYN2MDqSqYW1I9xnu6fq9o1e4lKuTyy+0MrIC+9N4Sa/03SPIq0q/fg8xb2toLRbPULz8I7522+j6l4VwA51j+dyuwMf03eMP2NK6TSpd1tXhwZ1JPoDTVd14jLCvNZZku4MLbu/DW5a4enJ3Ww/ojodqjIZuBHxo87f/HP3N7oiPOl18+/7Uwvb7l7CUeDIq4vfvzAgLyzZJ6pTKELYhGedDO21mXcJ+76DZG7Dc/caC9a/Y7DZajYVIFcTev6EZ0kQtzTSLcd6QbYom+z+5ErCp

Steps to reproduce the bug

  1. Click the button [Increment]

Expected behavior

Increase the value of ref n in store and update dom.

Actual behavior

TypeError: Cannot read properties of undefined (reading 'value')
    at _createElementBlock.onClick._cache.<computed>._cache.<computed> (<anonymous>:24:60)
    at callWithErrorHandling (runtime-dom.esm-browser.js:2344:19)
    at callWithAsyncErrorHandling (runtime-dom.esm-browser.js:2351:17)
    at HTMLButtonElement.invoker (runtime-dom.esm-browser.js:11266:5)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions