MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / setup

Function setup

packages/nuxt/src/client/piniaIntegration.ts:16–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 return {
15 name: INTEGRATION_NAME,
16 setup() {
17 if (!pinia || (typeof pinia === 'object' && !('use' in pinia))) {
18 consoleSandbox(() => {
19 // eslint-disable-next-line no-console
20 console.warn(
21 '[Sentry] The Pinia integration was added, but the passed parameter `pinia` has the wrong value. Make sure to enable Pinia by adding `"@pinia/nuxt"` to the Nuxt modules array and pass pinia to Sentry with `piniaIntegration(usePinia())`. Current value of `pinia`:',
22 pinia,
23 );
24 });
25 } else {
26 (pinia as Pinia).use(createSentryPiniaPlugin(options));
27 }
28 },
29 };
30}) satisfies IntegrationFn;
31

Callers

nothing calls this directly

Calls 4

consoleSandboxFunction · 0.90
createSentryPiniaPluginFunction · 0.90
warnMethod · 0.65
useMethod · 0.65

Tested by

no test coverage detected