},
})
```
+
+Since actions can be asynchronous, make sure **all of your `useStore()` calls appear before any `await`**. Otherwise, this could lead to using the wrong pinia instance _in SSR apps_:
+
+```js{7-8,11-13}
+import { defineStore } from 'pinia'
+import { useUserStore } from './user'
+
+export const useCartStore = defineStore('cart', {
+ actions: {
+ async orderCart() {
+ // ✅ call at the top of the action before any `await`
+ const user = useUserStore()
+
+ try {
+ await apiOrderCart(user.token, this.items)
+ // ❌ called after an `await` statement
+ const otherStore = useOtherStore()
+ // another action
+ this.emptyCart()
+ } catch (err) {
+ displayError(err)
+ }
+ },
+ },
+})
+```