From: Eduardo San Martin Morote Date: Mon, 28 Aug 2023 07:46:22 +0000 (+0200) Subject: feat(warn): improve getActivePinia warning X-Git-Tag: @pinia/nuxt@0.5.0~31 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4640f09d12094d8c2c2d9d2039b4479fd7d38d35;p=thirdparty%2Fvuejs%2Fpinia.git feat(warn): improve getActivePinia warning --- 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.` ) }