redsnake
redsnake
NNuxt
Created by redsnake on 11/6/2024 in #❓・help
New composable undetected
Hello there, i've been trying to fix my problem for hours and tried many things i will try to list here in order for someone to help me if possible ^^ Objective : Create a new composable backoffice/composables/api/useShopSubscriptionApi i came on a project where there is other composables in the same directory and i tried to fit to the syntax. But first problem, in my recently created composable, i could not use automatically interfaces and other composables just like on useShopSubscriptionApi for example is using
const getShops: (
pagination: PaginationPayloadInterface,
filters: ShopFilterInterface,
immediate?: boolean
) => FetchResult<ShopInterface[]> | FetchResultPaginated<ShopInterface[]> = (
const getShops: (
pagination: PaginationPayloadInterface,
filters: ShopFilterInterface,
immediate?: boolean
) => FetchResult<ShopInterface[]> | FetchResultPaginated<ShopInterface[]> = (
without any import. So i had to make the imports on the top of the file only on my new file... weird Then, when trying to use it into a .vue component via : const { data, status, error } = await useShopSubscriptionApi().getShopSubscriptions(, it's not recognized, but i didnt import it, okay. But no other vue file import any other composable, its automatic everywhere, and since i try to autocomplete import useShopSubscriptionApi from '../../composables/api/useS.... its not found. So i am pretty sure i have to run a command, index them somewhere or i dont know what i did miss. I tried - Restarting my IDE - clearing node modules and .nuxt and reinstalling everything - changing classic export default at the end of the file to export default (): ShopSubscriptionApiType => - I double checked for typos - i checked nuxt.config.ts - i dont have any .d.ts other files and other things i've forgotten. Pretty sure its not that hard but i require your lights 🥲
6 replies