Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

Can I use server actions in nextjs 15 for graphql request

if anyone can tell how to fetch graphql data on server side

Running getServerSideProps auth checks from external function call

```ts export const getServerSideProps: GetServerSideProps = async (ctx) => { const session = await getServerAuthSession(ctx); if (!session?.user.<AUTH_CHECK>) {...

What are the best learning resource for experienced developers?

Like there are tons of different resources and courses around, but they mostly focus on helping people who is just starting. So its hard to dig out or there is no info at all about when and why the specific tech/product is good, what its strong and weak points, specifics and pitfalls of application and deployment. So something that goes beyond "hello world" thing, that allows you to stay relevant with herds of tools, products, frameworks around and changes around them....

Are t3env client side env vars set at build time or runtime?

I know Next.js replaces process.env.NEXT_PUBLIC_* with values at build time, so I was wondering if this is the case with t3env? I'm building my app as a docker image (skipping env validation) so I can setup env vars when deploying. Are t3env client side env vars set at build time or runtime?...

How to Respond to a POST Request by Rendering Page Route with Access to the Request Payload

I'm working on an unusual use case in next js where I need to respond to a POST request by rendering a Next.js page. Specifically, I want to receive a POST request at /api/cars that includes car data in the payload. After receiving this request, I need to render the /cars page using the payload data and respond with the resulting HTML. How can I pass the payload data to the page route for server-side rendering and return the rendered HTML in the response to the POST request?

Next lint fail prisma edge

Hey, i got this error when i try to build my t3-app with prisma edge i have try to set the lint dir only to src but it doesn´t help. Have anyone a idea? Sorry for my bad english. ...

What would be the best or more efficient way to -partly- convert CodeIgniter to Next.js

Consider a large project that has been using PHP in Code Igniter for years. What would be the way to convert the project into a Next.js one? The PHP part won't be transferred immediately or not at all. So the question also includes not removing PHP (as the preferred option).

T3 mobile

Is there a way to develop web and mobile apps from a single repo using t3 stack?

Video not showing correct length on Windows Photos app

I don't suppose anyone knows why this issue is happening, I'm using the Windows Photos App on Windows 11. The files actual length is 6 hours, not the 26113 minutes/hours it's saying it is. If I open it in Media Player it's showing it as a "Stream". The file is NVENC HEVC video encoded with AAC audio encoded. I have the HEVC extension downloaded from Microsoft so I don't know what the issue is?
No description

Is there a way to trigger GitHub Copilot suggestions by pressing a key instead of showing always?

I keep accidentally accepting suggestions and I want to get to the bottom of this. There's two options I'm hoping for: 1. Never show the greyed-out suggestions unless I press a specific key. 2. Show the suggestions like usual, but change the accepting key from Tab to anything else. ...

NextJS (on vercel) or TanStack start for performing a lot of requests (in a simple manner)

Hi y'all, I got the following scenario and am debating using NextJS (on vercel) or Tanstack start. This is more of a demo/MVP use app, which needs to do the following: Having a table up to 1000 rows, it needs to execute an external call (to an LLM) for each row. Then, as each request (or every 5 requests) is done, show the result for each row in the table under a new column. The user should be able to interact with the UI in the meantime in a decent manner. My worry is: If I use nextjs on Vercel and those requests on the server side would I run into pretty large bills? In that case am I better just using TanStack Start and do those requests on the client side in batches?...

tRPC Query Invalidation Issue with Client-Side Data Fetching and Initial Data from server component

I’m fetching data using tRPC and passing it to a client component as initial data. The client component then re-fetches the exact same data using tRPC with this initial data as the basis. However, the search field doesn’t seem to invalidate the query properly. Why might this be happening, and how can I ensure the query invalidates as expected? This is the Server Component code ```tsx import { api } from '@/server/trpc/server';...

default env values from value

I am reading through the documentation of many secret vaults for my environment variables, as I am attempting to host my application on a vps. I don't want my secrets on the server that is executing the code though. Where would I look to implement something like this in env.js on server startup? Also would love any documentation surrounding this. Any help is greatly appreciated!

[next.js] should i cache this query?

i have a function that queries my database for a list of stories. if a user is logged in, the stories shown are automatically filtered based on categories and authors they have chosen to hide. should i cache the query results? i think that if i wrap the entire thing in unstable_cache, those query results will be shown to every user, but i'm not 100% sure....

uploadthing how to upload custom file type

Hello, How should I allow to upload only files that are from a custom type ? I need to allow only .igc files. These are basically text files with an igc extension. Here are specifications : https://xp-soaring.github.io/igc_file_format/igc_format_2008.html ... I believe there is no dedicated MIME type. Could you help me? I joined a sample. Thank you....

is trpc good for rest apis?

Is trpc good for making rest apis? cause i feel like api/trpc/posts.getLatest isnt that compeling of a url vs api/posts/latest. is their a way to change trpc to do something like api/posts/latest? or am i fundamentaliy looking at trpc wrong?

Is `loading.tsx` in the root of my Next.js project bad practice?

I just spend hours debugging an issue I had with router.refresh() - I was using UploadThing and I'd call router.refresh() inside of onClientUploadComplete to update the UI with the documents the user had uploaded. I would fetch the documents in the page (server component). This was causing the entire page to refresh and scrollbar to be reset etc. I eventually found that if I deleted the ROOT loading.tsx file, the router.refresh() wouldn't refresh the entire page - only the components that used the data I needed....

Is it expected for a default create T3 app to take 500ms+ on each route (in dev)

I tried running next dev --turbo with and without Drizzle, but I still can't understand why it's so slow in development mode when running locally. Should I try running React without Next.js or take other steps to improve it? ``` GET / 200 in 2353ms ✓ Compiled /api/trpc/[trpc] in 276ms [TRPC] post.create took 422ms to execute...

T3 Stack - Next Auth Bug

Hi Everyone. Recently started a new project with the create-t3. Using page router and nextAuthjs. After running in dev mode, I see the following error:...