Lautaro_dapin
Lautaro_dapin
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 10/2/2023 in #questions
Database migrations
Is there any tool to create migrations with typescript script support? like django or alembic has?? I only found kysely, which has a migration system but you still have to write your own migrations, which seem pretty stupid due to the fact that you have all the types to make it automagically
9 replies
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 2/17/2023 in #questions
Middleware doesn't load the `server.mjs` variables
I have the followinng middleware in src/middleware.ts
import {NextRequest, NextResponse} from 'next/server'
import {env} from 'src/env/server.mjs'

// This function can be marked `async` if using `await` inside
export function middleware(req: NextRequest) {
if (!['_next', 'favicon.icon', 'assets'].some(c => req.nextUrl.pathname.includes(c))) {
console.info('Match the path', req.url, req.nextUrl.pathname)
}

return NextResponse.next()
}

// See "Matching Paths" below to learn more
export const config = {
matcher: [
'/',
'/((?!api|_next/static|_next/image|favicon.ico).*)',
'/((?!users/login|users/register|users/forgot|users/activation|users/register).*)',
],

}
import {NextRequest, NextResponse} from 'next/server'
import {env} from 'src/env/server.mjs'

// This function can be marked `async` if using `await` inside
export function middleware(req: NextRequest) {
if (!['_next', 'favicon.icon', 'assets'].some(c => req.nextUrl.pathname.includes(c))) {
console.info('Match the path', req.url, req.nextUrl.pathname)
}

return NextResponse.next()
}

// See "Matching Paths" below to learn more
export const config = {
matcher: [
'/',
'/((?!api|_next/static|_next/image|favicon.ico).*)',
'/((?!users/login|users/register|users/forgot|users/activation|users/register).*)',
],

}
But i get the zod error because the serverSchema fails the parse.
❌ Invalid environment variables:
DATABASE_URL: Required
NODE_ENV: Required
❌ Invalid environment variables:
DATABASE_URL: Required
NODE_ENV: Required
9 replies
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 11/23/2022 in #questions
T3 Stacks requires internet?
Does tRCP requires internet connection for been used? I was in the field without internet conection and the requests to the backend tRCP were not been executed
6 replies