CuriouslyCory
CuriouslyCory
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 2/28/2024 in #questions
create-t3-turbo adding tailwind to additional packages
Found it. I missed adding it to the apps/nextjs/tailwind.config.ts in the content array.
4 replies
TTCTheo's Typesafe Cult
Created by Ryan on 8/18/2023 in #questions
Noob question: How to pass a string to a child component?
So it sounds like the react server component needs to run the query and pass the data as a prop to the client component.
// server component
import { db } from '@utils/database'

export async function DashboardPage() {
const user = await db.query()
// ...
return (
<Activate email={user.email} token={user.token} />
)
}
// server component
import { db } from '@utils/database'

export async function DashboardPage() {
const user = await db.query()
// ...
return (
<Activate email={user.email} token={user.token} />
)
}
18 replies
TTCTheo's Typesafe Cult
Created by Ryan on 8/18/2023 in #questions
Noob question: How to pass a string to a child component?
Looks like you're using nextjs from your imports. If you're doing server side rendering you'll need to use "getServerSideProps" to run your prisma call on the server, which then gets passed to the component. https://nextjs.org/docs/pages/building-your-application/rendering/server-side-rendering Alternatively (but doesn't look like your use case), if the inputs are known (think blog posts in a markdown directory, or database), you can use server side generation (SSG) in which case your HTML for each route would be built during the build process and served to the client when that route is requested. https://nextjs.org/docs/pages/building-your-application/rendering/static-site-generation
18 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 8/10/2023 in #questions
.env parsing causing cypress failure
I'll try that out @Rhys as reece
24 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 8/10/2023 in #questions
.env parsing causing cypress failure
Tried adding them directly to the cypress.config.ts file as well under the "env" key and still no dice.
24 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 8/10/2023 in #questions
.env parsing causing cypress failure
This is with and without the cypress.env.json.
24 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 8/10/2023 in #questions
.env parsing causing cypress failure
I added a console.log to the cypress.config.ts file to see, but can confirm that they are undefined at least at the point that the config file is loaded.
24 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 8/10/2023 in #questions
.env parsing causing cypress failure
I can't tell if trolling or serious 😅 It's the default create-t3-app .env file with some additional NEXT_PUBLIC && server only variables added. The variables all pass validation when run normally by npm run dev or next dev.
24 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 1/4/2023 in #questions
Public folder from create-t3-app trpc router?
Confirmed. Works on Vercel prod as well.
20 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 1/4/2023 in #questions
Public folder from create-t3-app trpc router?
Appears to be working, will test on vercel and report back.
20 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 1/4/2023 in #questions
Public folder from create-t3-app trpc router?
const fetchLocalImage = async (fileName: string): Promise<Buffer> => {
const dirRelativeToPublicFolder = `images/collections/layers/${fileName}`;

const dir = path.resolve("./public", dirRelativeToPublicFolder);

const data = await promises.readFile(dir);
return Buffer.from(data);
};
const fetchLocalImage = async (fileName: string): Promise<Buffer> => {
const dirRelativeToPublicFolder = `images/collections/layers/${fileName}`;

const dir = path.resolve("./public", dirRelativeToPublicFolder);

const data = await promises.readFile(dir);
return Buffer.from(data);
};
20 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 1/4/2023 in #questions
Public folder from create-t3-app trpc router?
I definitely could. I just need to find the best way to access them directly instead of via http.
20 replies
TTCTheo's Typesafe Cult
Created by CuriouslyCory on 1/4/2023 in #questions
Public folder from create-t3-app trpc router?
Mostly a timing thing since I only have 10seconds of processing time before it hits the timeout wall.
20 replies