tRPCttRPC
Powered by
MaksM
tRPCβ€’2y agoβ€’
1 reply
Maks

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({}))
  .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..
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Why deprecate experimental_standaloneMiddleware?
GabrielGGabriel / ❓-help
2y ago
Migrating v11 from classic client to TanStack Query: β€œError: experimental_prefetchInRender feature ”
Alfonso GuerraAAlfonso Guerra / ❓-help
7mo ago
middleware executed twice? should i use `experimental_standaloneMiddleware`?
y_nkYy_nk / ❓-help
7mo ago
How can I enable experimental Suspense on NextJS
gwilliamnnGgwilliamnn / ❓-help
3y ago