Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!