.Zeus.
.Zeus.
TTCTheo's Typesafe Cult
Created by .Zeus. on 12/3/2024 in #questions
T3 Stack Newbie, using NextJS 15 and tRPC, no utils/trpc.ts
Found the issue. I had the wrong env variable set for my db. Sorry! ❤️
8 replies
TTCTheo's Typesafe Cult
Created by .Zeus. on 12/3/2024 in #questions
T3 Stack Newbie, using NextJS 15 and tRPC, no utils/trpc.ts
Cannot read properties of undefined (reading 'findMany')
8 replies
TTCTheo's Typesafe Cult
Created by .Zeus. on 12/3/2024 in #questions
T3 Stack Newbie, using NextJS 15 and tRPC, no utils/trpc.ts
And my error: [[ << query #1 ]civilization.getAll {}
8 replies
TTCTheo's Typesafe Cult
Created by .Zeus. on 12/3/2024 in #questions
T3 Stack Newbie, using NextJS 15 and tRPC, no utils/trpc.ts
export const civilizationRouter = createTRPCRouter({
// Get all Civilizations
getAll: publicProcedure.query(async () => {
return prisma.civilization.findMany();
}),
});
export const civilizationRouter = createTRPCRouter({
// Get all Civilizations
getAll: publicProcedure.query(async () => {
return prisma.civilization.findMany();
}),
});
8 replies
TTCTheo's Typesafe Cult
Created by .Zeus. on 12/3/2024 in #questions
T3 Stack Newbie, using NextJS 15 and tRPC, no utils/trpc.ts
Router
export const appRouter = createTRPCRouter({
civilization: civilizationRouter,
unit: unitRouter,
age: ageRouter,
});
export const appRouter = createTRPCRouter({
civilization: civilizationRouter,
unit: unitRouter,
age: ageRouter,
});
8 replies
TTCTheo's Typesafe Cult
Created by .Zeus. on 12/3/2024 in #questions
T3 Stack Newbie, using NextJS 15 and tRPC, no utils/trpc.ts
Here's a class I am trying to get it going
"use client"

import { api } from "@/trpc/react";
import { type Civilization } from "@prisma/client";

export const CivPicker = () => {
const civilizationQuery = api.civilization.getAll.useQuery();

return (
<div>
{civilizationQuery.data?.map((civilization: Civilization, index: number) => (
<p key={index}>{civilization.name}</p>
))}
</div>
);
};
"use client"

import { api } from "@/trpc/react";
import { type Civilization } from "@prisma/client";

export const CivPicker = () => {
const civilizationQuery = api.civilization.getAll.useQuery();

return (
<div>
{civilizationQuery.data?.map((civilization: Civilization, index: number) => (
<p key={index}>{civilization.name}</p>
))}
</div>
);
};
8 replies