The answer was provided by @Phil. In the docs there is a link about not destructuring the store. The correct way was to change
const { generateCards } = useCardsStore()
to
const store = useCardsStore()
and use store.generateCards
instead of store
in the template.