#Getting error of version `ZLIB_1.2.9' not found while deploying next js app on vercel

1 messages · Page 1 of 1 (latest)

flint ivyBOT
#

Hi @flat marsh. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. However, the error you're encountering seems to be related to a specific library (ZLIB_1.2.9) not being found during the build process. This could be due to a variety of reasons such as a missing or incorrect path, or the library not being installed or included in your project dependencies.

You might want to check your project's dependencies and ensure that the required libraries are correctly installed and referenced. If the issue persists, it could be helpful to look into the specific library causing the issue (in this case, ZLIB_1.2.9) and see if there are known issues or solutions related to it.

For more information on troubleshooting build errors with Vercel, you can refer to the Vercel documentation (https://vercel.com/docs/deployments/troubleshoot-a-build).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@flat marsh kapa.ai is still learning and improving, please let us know how it did by reacting below

flat marsh
#

@flint ivy how to deploy website contiaining canvas as lib on vercel

flint ivyBOT
#

Let me check the knowledge base for you. One moment! :books:

#

Deploying a website that contains the canvas library on Vercel involves several steps. Here's a general guide based on the information provided in the extracts:

  1. Create a new Github repository and push your local changes. This is necessary because Vercel deploys your project directly from a Git repository. Source (https://vercel.com/templates/next.js/roadmap-voting-starter-kit)

  2. Deploy your project to Vercel. You can do this by importing your Git repository on Vercel. This can be done by clicking the New Project (https://vercel.com/new) button from the Vercel dashboard and selecting your Git provider (GitHub, GitLab, or Bitbucket). Source (https://vercel.com/docs/deployments/overview)

  3. Add all Environment Variables in your .env file to Vercel during the import process. This is important to ensure that all necessary environment variables are available during the build and deployment process. Source (https://vercel.com/templates/next.js/roadmap-voting-starter-kit)

  4. Vercel will automatically start deploying the project. This starts with building your project, then assigning the domain, and finally celebrating your deployed project. Source (https://vercel.com/docs/getting-started-with-vercel/template)

  5. View your deployment. Once the deployment is complete, you can view it by visiting the unique Generated URL that Vercel automatically adds to your deployment. Source (https://vercel.com/docs/deployments/overview)

#

Please note that if you're using specific libraries like canvas, you might need to ensure that they are correctly installed and configured in your project. If you encounter any issues during the deployment process, you might find the Vercel documentation (https://vercel.com/docs) helpful for troubleshooting.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@flat marsh kapa.ai is still learning and improving, please let us know how it did by reacting below

flat marsh
flint ivyBOT
#

Let me check the knowledge base for you. One moment! :books:

#

The error message you're seeing is related to the way Next.js handles static generation of pages. In Next.js, pages are pre-rendered by default. This means that Next.js generates HTML for each page in advance, instead of having it all done by client-side JavaScript. Pre-rendering can result in better performance and SEO.

However, there are certain cases where a page cannot be pre-rendered. One such case is when a page uses request.url. This is because request.url is only available at request time, and not at build time, which is when static generation occurs.

To resolve this issue, you might need to change your approach. If you need to use request.url, consider using Server Side Rendering (SSR) or Client Side Rendering (CSR) instead of Static Generation.

For more information, you can refer to the Next.js documentation on data fetching (https://nextjs.org/docs/basic-features/data-fetching).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@flat marsh kapa.ai is still learning and improving, please let us know how it did by reacting below

flat marsh
#

Error: Runtime exited with error: exit status 1
export const GET = async (req: Request) => {

try {
const icons = await db.icon.findMany({
where: {
public: true,
},
orderBy: {
createdAt: "desc",
},
// skip: (page - 1) * 24,
// take: 24,
});

return NextResponse.json({ icons }, { status: 200 });

} catch (e) {
console.log(e);
return NextResponse.json({ message: "failed" }, { status: 401 });
}}
@flint ivy i am getting erorr

flint ivyBOT
#

Let me check the knowledge base for you. One moment! :books:

#

The error message "Runtime exited with error: exit status 1" typically indicates that your program has encountered an error and has exited prematurely. In your case, it seems like the error might be occurring when you're trying to fetch data from your database.

Here are a few things you could try to resolve this issue:

  1. Check your database connection: Ensure that your application is able to connect to your database correctly. This could involve checking your connection string, or ensuring that your database server is running and accessible.

  2. Handle potential errors in your database query: Your code is using db.icon.findMany() to fetch data from your database. If there's an issue with this query (for example, if the icon table doesn't exist, or if the public field doesn't exist), this could cause your program to exit with an error. You might want to add some error handling code to catch and log any errors that occur during this query.

  3. Check the data returned by your database query: If your database query is returning data that your code isn't expecting (for example, if it's returning null or undefined), this could cause your code to throw an error. You might want to add some checks to ensure that the data returned by your query is valid before you try to use it.

If you're still having trouble, you might find it helpful to log the error message that's being caught in your catch block. This could give you more information about what's going wrong. You can do this by changing your console.log(e); line to console.error(e);. This will print the error message to your console, which could help you diagnose the issue.

#

@flat marsh kapa.ai is still learning and improving, please let us know how it did by reacting below

flat marsh
#

@flint ivy localy its fine but on production its showing error

flint ivyBOT
#

Let me check the knowledge base for you. One moment! :books:

#

If your application works fine locally but not in production, it could be due to a number of reasons. Here are a few things you could check:

  1. Environment Variables: Ensure that all environment variables used in your application are correctly set in your production environment. These might include database URLs, API keys, or other configuration variables.

  2. Dependencies: Make sure that all the dependencies of your project are correctly installed in the production environment. This includes any libraries or packages that your application relies on.

  3. Database: If your application connects to a database, ensure that the database is correctly set up and accessible from your production environment.

  4. Error Logs: Check the error logs in your production environment. They might provide more information about what's going wrong.

Without more specific information about the error you're encountering, it's hard to provide a more detailed answer. If you're still having trouble, you might find it helpful to refer to the Vercel documentation (https://vercel.com/docs) for more information on troubleshooting deployment issues.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@flat marsh kapa.ai is still learning and improving, please let us know how it did by reacting below

flat marsh
#

@flint ivy The problem i am facing is my next js locally is working fine
const formData = await req.formData();

but in vercel its stop at this line
without giving any error its just says time up error
Testing is done using telegram bot after this line nothing execute
is this due to limits

flint ivyBOT
#

Let me check the knowledge base for you. One moment! :books: