N
Nuxt3y ago
Zampa

What is the recommended way to explicitly import $fetch or useCookie into a Pinia store?

import { $fetch } from 'ofetch';
import { useCookie } from '#imports';
import { $fetch } from 'ofetch';
import { useCookie } from '#imports';
? I'm trying to ensure that whenever @nuxt/test-utils-edge pulls in the store for a test that it can find those normally auto-imported helpers/composables.
1 Reply
Zampa
ZampaOP3y ago
Looks like this works, but it seems clunky, right?
import { useCookie } from '../node_modules/nuxt/dist/app/composables/cookie';
import { useCookie } from '../node_modules/nuxt/dist/app/composables/cookie';
Want results from more Discord servers?
Add your server