You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
what is the recommended approach to inferring the type in SomeComponent?
I tried the following:
server/trpc/routers/index.ts:
import { router } from '../trpc'
import type { inferRouterOutputs } from '@trpc/server'
import { fooRouter } from './foo'
export const appRouter = router({
foo: fooRouter
})
export type AppRouter = typeof appRouter
export type RouterOutput = inferRouterOutputs
components/SomeComponent.vue:
import { type RouterOutput } from 'server/trpc/routers'
defineProps<{foo: RouterOutput['foo']['get']}>()
but this results in the error A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function..
Before I go deeper down the rabbit hole, I wonder if there's something I couldn't find in the docs that help with this.
The text was updated successfully, but these errors were encountered:
Given this page.vue:
what is the recommended approach to inferring the type in SomeComponent?
I tried the following:
server/trpc/routers/index.ts:
components/SomeComponent.vue:
but this results in the error
A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function.
.Before I go deeper down the rabbit hole, I wonder if there's something I couldn't find in the docs that help with this.
The text was updated successfully, but these errors were encountered: