-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I have the following store defined:
import { defineStore } from 'pinia'
export const useProductsStore = defineStore('products', {
state: () => ({
products: [] as Product[]
}),
getters: {
products: (state) => state.products
},
actions: {
setProducts(products: Product[]) {
this.products = products
}
}
})
Let's say I have my productStore defined in setup as follows:
const productStore = useProductsStore()
When I essentially call productStore.setProducts([]), I see this bizarre error.
(FWIW, the products are coming back from an API as blank)
Expected behavior
No error, I should be able to set my products to an empty array without issue.
Actual behavior
I see the following error:
index.ts:16 Uncaught (in promise) TypeError: 'set' on proxy: trap returned falsish for property 'products'
Additional information
pinia version 2.0.11
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels