Ignition 98
Ignition 98
TtRPC
Created by Ignition 98 on 6/2/2024 in #❓-help
experimental_nextAppDirCaller ERROR
Hey y'all 🙂 I'm reading new blog post by @julius about TRCP with Next Server Actions approach. Was following the steps to use .experimental_caller(experimental_nextAppDirCaller({})) Here is my procedure:
const nextProcedure = t.procedure
.use(tracing({ collectInput: true, collectResult: true }))
.use(async ({ ctx, next }) => {
// Injecting context
const log = ctx.log
const start = Date.now()
const res = await next({ ctx: { ...ctx, log } })
const duration = Date.now() - start

if (res.ok) log.info({ duration, result: res.data })
else log.error({ duration, error: res.error })

return res
})
.experimental_caller(experimental_nextAppDirCaller({}))
const nextProcedure = t.procedure
.use(tracing({ collectInput: true, collectResult: true }))
.use(async ({ ctx, next }) => {
// Injecting context
const log = ctx.log
const start = Date.now()
const res = await next({ ctx: { ...ctx, log } })
const duration = Date.now() - start

if (res.ok) log.info({ duration, result: res.data })
else log.error({ duration, error: res.error })

return res
})
.experimental_caller(experimental_nextAppDirCaller({}))
Wanted to ask why is it causing this error?
Argument of type '{}' is not assignable to parameter of type '{ normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ db: PostgresJsDatabase<{ Post: PgTableWithColumns<{ name: "post"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "post"; dataType: "string"; columnType: "PgUUID"; ... 5 more ...; baseColumn: never; }, {}, {}>; tit...'.
Property 'createContext' is missing in type '{}' but required in type '{ normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ db: PostgresJsDatabase<{ Post: PgTableWithColumns<{ name: "post"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "post"; dataType: "string"; columnType: "PgUUID"; ... 5 more ...; baseColumn: never; }, {}, {}>; tit...'.ts(2345)

rootConfig.d.ts(76, 5): 'createContext' is declared here.
Argument of type '{}' is not assignable to parameter of type '{ normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ db: PostgresJsDatabase<{ Post: PgTableWithColumns<{ name: "post"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "post"; dataType: "string"; columnType: "PgUUID"; ... 5 more ...; baseColumn: never; }, {}, {}>; tit...'.
Property 'createContext' is missing in type '{}' but required in type '{ normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ db: PostgresJsDatabase<{ Post: PgTableWithColumns<{ name: "post"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "post"; dataType: "string"; columnType: "PgUUID"; ... 5 more ...; baseColumn: never; }, {}, {}>; tit...'.ts(2345)

rootConfig.d.ts(76, 5): 'createContext' is declared here.
As in the example createContext is not passed anywhere, but its required by the experimental_nextAppDirCaller func..
2 replies
TtRPC
Created by Ignition 98 on 1/4/2024 in #❓-help
TRPC to connect a client app with a backend apigateway ?
Hi everyone! Is it a good practice to use TRPC to connect my client application (Next.Js) with my backend RESTful APIGateway app (Nest.Js) that plays a role of an entry point to other micro-services. Are there best practices for such use cases ? Would appreciate some examples of recommendations! Thanks!
4 replies
TtRPC
Created by Ignition 98 on 11/12/2023 in #❓-help
Difference between createTRPCNextAppDirServer, createTRPCNext and createTRPCProxyClient?
Hey everyone. I struggle to understand the difference between these 3 TRPC functions when it come to using it in server.ts to be able to make server side API calls. I'm using NextJS 14 and app router. Is there clear differentiation between these 3? This project is for a production release. Would greatly appreciate a little break down. Thanks!
30 replies