]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
feat(warn): improve getActivePinia warning
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 28 Aug 2023 07:46:22 +0000 (09:46 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 28 Aug 2023 07:46:22 +0000 (09:46 +0200)
packages/pinia/src/store.ts

index a540e1d973eeb7efe17f3e7fbdb31f6d0605c8cc..e76381f0413583c03f612949130c729b892a6c5b 100644 (file)
@@ -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.`
       )
     }