Lukáš Papcun
Lukáš Papcun
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Lukáš Papcun on 5/3/2024 in #questions
Best fully typesafe, fully managed, headless CMS with a generous free tier for Next.js 14.
Hi, what headless CMSes do you like/recommend the most? I recently tried Sanity and did not like it that much as it lacks typesafety so I tried using @sanity-typed with it which improved the DX a whole lot and added typesafety, but it turns out that the Sanity studio does not play very nicely with @sanity-typed. I am looking for a headless CMS, which is fully typesafe, has a premade dashboard to manage content and has a generous free tier. Santiy checked nearly all of these boxes but the lack of proper typesafety was a no go for me. I was thinking about Payload CMS, but it requires me to host a separate express server AFAIK. So I looked into Payload 3.0 Beta which looks great, fully Next.js native - wow exactly what I wanted and I only need to host the db, seems like a no brainer for me, Tho, I do not want to use Beta software and I would really hate starting with V2 and then just shortly after migrate to V3. I would also highly appriciate if the CMS to worked with Cloudinary.
2 replies
TtRPC
Created by Lukáš Papcun on 5/2/2024 in #❓-help
How to disable Next.js draftmode in tRPC?
Hi guys, is it possible to disable the Next.js draft mode using tRPC? I am tryin to achieve something such as this:
import { draftMode } from 'next/headers';
import { NextRequest, NextResponse } from 'next/server';

export function GET(request: NextRequest) {
draftMode().disable();
const url = new URL(request.nextUrl);
return NextResponse.redirect(new URL('/', url.origin));
}
import { draftMode } from 'next/headers';
import { NextRequest, NextResponse } from 'next/server';

export function GET(request: NextRequest) {
draftMode().disable();
const url = new URL(request.nextUrl);
return NextResponse.redirect(new URL('/', url.origin));
}
But with tRPC, I tried calling draftMode().disable(); in my tRPC function but nothing happened, draftMode did not get disabled.
2 replies
PPrisma
Created by Lukáš Papcun on 4/24/2024 in #help-and-questions
Prisma not working on middleware even tho the app is being ran on a server.
Hi guys, I keep getting this error when using Prisma with Next.js 14 app, I plan to run my app on a server in a docker container so not edge runtime will be used, but I keep getting this:
[Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters

If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report]
[Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters

If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report]
How should I fix this error?
2 replies