Thrustgamers
Thrustgamers
TtRPC
Created by Thrustgamers on 8/29/2023 in #❓-help
TRPC undefined when exporting
Hi i am working on merging routers from different files but when exporting the router property it comes out as undefined. This is the current code for it
//Index file
const trpc = initTRPC.create();
export const publicProcedure = trpc.procedure
export const router = trpc.router

console.log(router) // logs a function as normal
//Index file
const trpc = initTRPC.create();
export const publicProcedure = trpc.procedure
export const router = trpc.router

console.log(router) // logs a function as normal
// First router file
import { publicProcedure, router } from './index';

console.log(publicProcedure) //comes back undefined
console.log(router) //comes back undefined
// First router file
import { publicProcedure, router } from './index';

console.log(publicProcedure) //comes back undefined
console.log(router) //comes back undefined
If any other code parts need to be provides, do please let me know
2 replies