Skip to content
Discussion options

You must be logged in to vote

You can check if it's tree shaken here: https://next-code-elimination.now.sh/, looks like your code is not tree shaken currently because it imports a type from the prisma module 🤔

However looking at the code you probably want to use https://nextjs.org/docs/basic-features/data-fetching#typescript-use-getserversideprops InferGetServerSidePropsType which is nicer anyway as it automatically infers the types from the prisma fetching you're doing

import { PrismaClient } from "@prisma/client"
import { GetServerSideProps, InferGetServerSidePropsType } from "next"
import React from "react"

const prisma = new PrismaClient()

async function getOrg(slug: string | string[] | undefined) {
  if (!slug || 

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lkbr
Comment options

Answer selected by lkbr
Comment options

You must be logged in to vote
1 reply
@lkbr
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants