Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
38 replies
embersee

Error on adding t3 app router to existing NextJS project

Hi, so i've init'ed the new t3app router template, and tried to transition it to an existing project. I can get Client-side tRPC calls to work, but Server-side tRPC calls give this error:

 >> query  #1 hello.hello  { input: undefined }
 << query  #1 hello.hello  {
  input: undefined,
  result: TRPCClientError: fetch failed
      at TRPCClientError.from (webpack-internal:///(rsc)/./node_modules/@trpc/client/dist/TRPCClientError-0de4d231.mjs:41:16)
      at eval (webpack-internal:///(rsc)/./node_modules/@trpc/client/dist/httpBatchLink-cee1f56c.mjs:207:101)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    meta: undefined,
    shape: undefined,
    data: undefined,
    [cause]: TypeError: fetch failed
        at Object.fetch (node:internal/deps/undici/undici:11413:11)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
      cause: [Error]
    }
  },
  elapsedMs: 45
}
 ⨯ node_modules/@trpc/client/dist/TRPCClientError-0de4d231.mjs (37:15) @ TRPCClientError.from
 ⨯ Internal error: TRPCClientError: fetch failed
    at TRPCClientError.from (./node_modules/@trpc/client/dist/TRPCClientError-0de4d231.mjs:41:16)
    at eval (./node_modules/@trpc/client/dist/httpBatchLink-cee1f56c.mjs:207:101)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Cause: TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11413:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: getaddrinfo ENOTFOUND https
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
      at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'https'
  }
}


I can't seem to wrap my head around what the error is about...
Will add to this post as i figure it out.
Was this page helpful?