Are the libraries referenced exclusively in getServerSideProps included in the bundle by NextJS?

I have a Next.js page where I am fetching data from a database using prisma as the ORM within the getServerSideProps() function.

I'm following an example provided in this official Prisma github repository. Here's a simplified version of how my page is set up:

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;

In this setup, Prisma is imported into the page file and utilized in getServerSideProps(), but it is not directly used in the exported page component itself. Now, my inquiry is whether Prisma will be included in the bundle that is sent to the browser along with this page. Or does Next.js automatically exclude packages that are only referenced in server-side functions?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using the Button within Material-Table to Trigger an OnClick Event

Hello! I need assistance with a functionality where clicking the button "xet duyet" should switch to another component (Checkdetail) without displaying its content. Can you provide me with a solution to this issue? Thank you in advance! I have made some a ...

Determine the name of the time zone using JavaScript

Currently, I am developing a React application and facing an issue where the timezone is detected as 'Etc/GMT-1' instead of the desired format 'Africa/Bangui'. This problem seems to be specific to my machine as it persists even when usi ...

Twitter: cease monitoring stream events following X callback

//Just starting out with node.js I'm new to using ntwitter for listening on twitter statuses. Is there a way to stop listening after a certain number of callbacks have been called? var twittsCounter = 0; twit.stream('statuses/filter', { ...

Using JavaScript to disable and re-enable an ASP.NET Timer control

I currently have a webpage built with ASP.Net that includes an ASP:Timer control <asp:Timer ID="TimerRefresh" runat="server" Interval="5000" Enabled="true" OnTick="TimerRefresh_Tick"> </asp:Timer> It is connected to an asp:UpdatePanel on the ...

Expand the data retrieved from the database in node.js to include additional fields, not just the id

When creating a login using the code provided, only the user's ID is returned. The challenge now is how to retrieve another field from the database. I specifically require the "header" field from the database. Within the onSubmit function of the for ...

An npm list is always full of modules

As I prepare to install a package using npm, I noticed that my folder for the new project already has numerous items listed when I run npm list. Is it normal for the folder not to be empty at this stage? Have I made an error somewhere? ...

AngularJS - Smoothly navigate to the top of the page by swiping left or right

I'm currently working on a project in angularJS and ionic that involves a slidebox with three slides, each containing different content. My goal is to scroll back to the top every time I switch between slides. Initially, I thought using on-swipe-left ...

Tips for showcasing and reaching specific key values using JADE

As I iterate through my object, everything functions correctly, and I can display all instances of it on the page. However, my challenge arises when I attempt to select a specific object key to render its corresponding value on the page. Below is my code ...

Error encountered while trying to fetch data from http://localhost:3000/api/gear using NextJS with Vercel and MongoDB integration: FetchError - connection to 127.0.0.1:3000 refused

My current setup involves using NextJS to make API calls to MongoDB. When I access the API link, I am able to see the MongoDB query being returned. However, when I attempt to fetch this data to display on a webpage, I encounter a 500 Internal Server Error. ...

Error in Next.js server: "Module not found"

Latest version: 13.4.12 Current Node version: 18.17.0 Upon creating a new Next.js application with "npx create-next-app@latest" and running npm run dev right after setup, the following error is encountered: Server Error Error: Module "C:\Users\ ...

Should I release an Aurelia component on NPM?

Our team has developed a compact Aurelia application and now we are looking to seamlessly incorporate it into a larger codebase. One possible scenario is distributing the Aurelia app on NPM to allow other projects to easily integrate our code. What steps ...

File index with Node.js server for handling files

I currently have a code snippet for setting up a file server that serves files from a static folder named "public1". However, I am facing difficulties in making an HTML page display by default when a user navigates to the IP address in a browser. Although ...

Utilize jQuery to showcase a chosen cryptocurrency from coinmarketcap's API

I've been attempting to retrieve specific coin data from the Coinmarketcap API using JavaScript, but for some reason, nothing seems to be working. I'm really puzzled about where I might have gone wrong... var coin = "spectrecoin"; $.get("https ...

"Calculating the total value of an array based on its individual elements

My API response includes committers to a git project, but some members are repeated because they share the same name with different email addresses. Example response: [ {"id": "122334", "name": "bob", "commits":10, "email": "<a href="/cdn-cgi/l/emai ...

What is the method for individually extracting values from HTML using class li?

Is there a way to extract each value from the HTML within the li class separately? I have tried various methods but none have been successful. Can anyone provide a solution? Here is my JavaScript code: $(document).ready(function() { $(".list-grou ...

Issue with PHP retrieving initial value of post data

Hi there, I am facing an issue with my PHP code where the first value of the input field is not being displayed. However, when I check the console.log, it shows correctly. Here is my console.log output: https://i.sstatic.net/eZvg6.png PHP Output: https ...

Absence of receiving any HTTP error codes when making REST calls

In our application, it is crucial to differentiate between 400 and 500 range error codes for distinct processes. Let's consider three REST calls: The first returns a status code of 200, the second returns 401, and the third returns 502 Initially, ...

Failed to convert value to a string

I'm dealing with a frustrating issue and I just can't seem to figure it out. The error message I'm getting is Cast to string failed for value "{}" at path "post". { "confirmation": "fail", "message": { "message": "Cast to string fai ...

Setting up and customizing Express with Angular

Currently working on a straightforward Angular/Express todo-list app, I encountered some difficulties. As the project is still in progress, after running the code on localhost:3000, I noticed that {{ thing }} was displayed literally on the webpage. The di ...

Error message in reactjs: When reloading, the function is not recognized as .map

When using material ui components within a .map of an array, attempting to modify one of the displayed values causes my app to crash and displays an error saying that .map is not a function. Below, I will share the code where this issue occurs. <div cl ...