Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
Does NextJS include libraries that are referenced only in getServerSideProps in the bundle?

I have a Next.js page that is fetching data from a database (using prisma as the ORM) inside of getServerSideProps().

I working based on this example from an official Prisma github. Here is a simplified version of the page setup:

import prisma from 'prisma';

export const getServerSideProps = async ({ req, res }) => {
  const drafts = await prisma.post.findMany(...);
};

const MyPage = () => {return <div>Hello</div>};
export default MyPage;

Prisma is imported into the page file and is referenced in getServerSideProps() but is not referenced in the actual page component that is exported. My question is, will prisma be included in the bundle sent to the browser with this page? Or is Next smart enough to trim packages that are referenced only in server-side functions?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

No. It will not be bundled to the client side. Next.js is indeed smart enough.

Refer here : https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering

enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda