From 4640f09d12094d8c2c2d9d2039b4479fd7d38d35 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 28 Aug 2023 09:46:22 +0200 Subject: [PATCH] feat(warn): improve getActivePinia warning --- packages/pinia/src/store.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/pinia/src/store.ts b/packages/pinia/src/store.ts index a540e1d9..e76381f0 100644 --- a/packages/pinia/src/store.ts +++ b/packages/pinia/src/store.ts @@ -903,9 +903,8 @@ export function defineStore( if (__DEV__ && !activePinia) { throw new Error( - `[🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia?\n` + - `\tconst pinia = createPinia()\n` + - `\tapp.use(pinia)\n` + + `[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?\n` + + `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\n` + `This will fail in production.` ) } -- 2.47.2