Matthew
Matthew
TTCTheo's Typesafe Cult
Created by Matthew on 7/28/2024 in #questions
ERROR: o [TRPCClientError]: Invalid response or stream interrupted
@Juraj98 I am not! This is just the starter template from create t3 app latest. so not far along in this project
13 replies
TTCTheo's Typesafe Cult
Created by Matthew on 7/28/2024 in #questions
ERROR: o [TRPCClientError]: Invalid response or stream interrupted
@William thanks for this suggestion. I will test this out today and get back to you. Out of curiousty do you know why the default code works but removing the other api call suddenly breaks and needs to be reworked?
13 replies
TTCTheo's Typesafe Cult
Created by Matthew on 7/28/2024 in #questions
ERROR: o [TRPCClientError]: Invalid response or stream interrupted
code snippet for what builds now
import { LatestPost } from "~/app/_components/post";
import { api, HydrateClient } from "~/trpc/server";

export const dynamic = "force-dynamic";

export default async function Home() {
void api.post.getLatest.prefetch();
return (
<HydrateClient>
<main className="flex min-h-screen flex-col items-center justify-center">
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-16">
<LatestPost />
</div>
</main>
</HydrateClient>
);
}
import { LatestPost } from "~/app/_components/post";
import { api, HydrateClient } from "~/trpc/server";

export const dynamic = "force-dynamic";

export default async function Home() {
void api.post.getLatest.prefetch();
return (
<HydrateClient>
<main className="flex min-h-screen flex-col items-center justify-center">
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-16">
<LatestPost />
</div>
</main>
</HydrateClient>
);
}
13 replies
TTCTheo's Typesafe Cult
Created by Matthew on 7/28/2024 in #questions
ERROR: o [TRPCClientError]: Invalid response or stream interrupted
adding
export const dynamic = "force-dynamic";
export const dynamic = "force-dynamic";
solves my issue but i still don't understand why removing this
const hello = await api.post.hello({ text: "from tRPC" });
const hello = await api.post.hello({ text: "from tRPC" });
suddenly breaks the build?
13 replies
TTCTheo's Typesafe Cult
Created by Matthew on 7/28/2024 in #questions
ERROR: o [TRPCClientError]: Invalid response or stream interrupted
More context for the error on a local build
Generating static pages (0/4) [ ] << query #1 post.getLatest {
input: undefined,
result: a [TRPCClientError]: fetch failed
at a.from
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:11372:11)
at process.processTicksAndRejections {
cause: [Error]
}
},
elapsedMs: 10
}
a [TRPCClientError]: fetch failed
at a.from
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
meta: undefined,
shape: undefined,
data: undefined,
digest: '2771849415',
[cause]: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11372:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.fetch (/Users/x/y/z/.next/server/chunks/258.js:2:65199) {
cause: Error: connect ECONNREFUSED ::1:3000
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 3000
}
}
}

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Generating static pages (0/4) [ ] << query #1 post.getLatest {
input: undefined,
result: a [TRPCClientError]: fetch failed
at a.from
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:11372:11)
at process.processTicksAndRejections {
cause: [Error]
}
},
elapsedMs: 10
}
a [TRPCClientError]: fetch failed
at a.from
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
meta: undefined,
shape: undefined,
data: undefined,
digest: '2771849415',
[cause]: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11372:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.fetch (/Users/x/y/z/.next/server/chunks/258.js:2:65199) {
cause: Error: connect ECONNREFUSED ::1:3000
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 3000
}
}
}

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
13 replies
TTCTheo's Typesafe Cult
Created by Matthew on 7/28/2024 in #questions
ERROR: o [TRPCClientError]: Invalid response or stream interrupted
I tried awaiting
void api.post.getLatest.prefetch();
void api.post.getLatest.prefetch();
I realized I don't understand how all of this works and would be grateful if someone could explain to me what the issue is with the changes I made!
13 replies
TTCTheo's Typesafe Cult
Created by Matthew on 1/14/2024 in #questions
504 timeout for large data request
https://vercel.com/docs/functions/configuring-functions/duration when i view this. if i have something under src/api/x can i set the max duration and limit here or is that only for functions under src/pages/api stream of consciousness here but just not 100 percent sure what the right answer is
6 replies
TTCTheo's Typesafe Cult
Created by Matthew on 1/14/2024 in #questions
504 timeout for large data request
also, for context i am on the pro plan for vercel, and using pages router, basic t3 setup
6 replies
TTCTheo's Typesafe Cult
Created by Matthew on 11/30/2023 in #questions
looking for the theo video where...
@techblooded thank you! for anyone else here is the youtube link https://www.youtube.com/watch?v=JfZPz6PWGtA****
4 replies