Questions tagged [vercel]

Seeking assistance with software development queries related to Vercel, an innovative cloud deployment platform optimized for front-end applications.

What is the process of setting up a proxy for Clerk authentication in a Next.js/Vercel application?

Following the Clerk documentation has been a bit challenging as it seems to lack some crucial information: In my simple Next.js 14 app using the app router pattern and app directory, they mention adding 3 headers to the proxy: Clerk-Proxy-Url: Should con ...

Vercel deployment issue: Hidden input values not being detected as expected

Whenever I attempt to update the data on Vercel, an error message is displayed: invalid input syntax for type uuid: "undefined" - unable to save Oddly enough, the data updates successfully when done locally. This is how I submit the form: <form onSu ...

Having trouble accessing my account due to authentication issues

Exploring the realms of next-auth and prisma is an exciting journey for me as a newcomer. As I ventured into integrating them for authentication on a website, everything seemed to function seamlessly in development mode. However, upon attempting to sign in ...

Experiencing ERR_TOO_MANY_REDIRECTS while using Next.js with Vercel and a Custom Domain through Cloudflare

I'm having trouble getting my Next.js project set up on Vercel with a custom domain managed through Cloudflare. Despite configuring the DNS and SSL settings correctly, I keep seeing a net::ERR_TOO_MANY_REDIRECTS error when trying to access my site at www.e ...

The deployment on Vercel is encountering an issue because it cannot find the React Icons module, even though it has been successfully installed

My attempt to deploy a project on Vercel is encountering an error during the building phase. The error message states that React icons cannot be found, even though they are installed in the package.json file and imported correctly in the component using th ...

The database server at `aws.connect.psdb.cloud` was unable to authenticate the credentials provided for database `name`, resulting in authentication failure

Currently, I am using PlanetScale with Prisma on a Next.js app that I am attempting to host on Vercel. It runs smoothly on localhost without any errors, but when I try to deploy it, I encounter this authentication error: "Authentication failed against the ...

Error message: "There was an uncaught DOMException promise when using Document.querySelector with a Google Fonts link in a NextJS

Upon deploying my Next app to Vercel, I encountered an error with the following message: Uncaught (in promise) DOMException: Document.querySelector: 'style[data-href="https://fonts.googleapis.com/css2?family=Mulish:wght@400;500;600;700;800;900&am ...

Encountering issues with middleware functionality upon deployment on Vercel

Hey there! I have been using the headless CMS 'next-wordpress-starter' for my blog, and I recently added a middleware to manage traffic from a specific site ('x') by redirecting it back to that site. Everything was working smoothly on my local environment, ...

The upcoming deployment encounters issues specifically with Amplify

I have been attempting to deploy my Next.js app on AWS Amplify, but unfortunately, it keeps failing. The build process worked flawlessly in my local environment, and I was even successful in deploying it on Vercel. However, for some reason, it only fai ...

What steps should I take to resolve the NextRouter "not mounted" error when deploying my Next JS 13 app on Vercel

I am encountering an issue while deploying my Next.js 13 app. The error message states: Module not found: Can't resolve 'encoding' in '/vercel/path0/node_modules/node-fetch/lib' Additionally, I am facing a "Next Router not mounted" error. Error: NextRout ...

How can I implement a GET request in NextJS 13.4 to fetch all items or by a specific ID? Should I use Response, NextAPIResponse, or NextResponse with the latest App Router features?

What is the proper method for performing a GET request (either to retrieve all items or by a specific ID) in NextJS 13.4 using the new App Router? The old approach of handling GET requests with NextAPIRequest, NextAPIResponse, checking if (req.method === ...

The error message displayed by Turborepo indicates that npm is not installed

? Please select a package manager: npm (currently not installed) pnpm yarn (currently not installed) ? Which package manager would you like to use? npm pnpm yarn (currently not installed) ...

Deploy the Next.js app on Vercel without regenerating pages, and instead trigger the deployment only upon request

Greetings to my fellow developers, For the past year, I have been using Next.js on Vercel and so far, I am absolutely loving it. The ability to create SEO friendly React websites has been a game changer for me. However, as my website continues to grow and ...

"Encountering a 404 error with NextAuth when deploying on Verc

My current setup involves using a CustomProvider as a Python backend server for app authentication: import CredentialsProvider from 'next-auth/providers/credentials' import NextAuth from 'next-auth' import { postLogin } from '../.. ...

Unable to locate module during deployment to Vercel platform

I have developed a website using NextJS. It functions perfectly when I run it through npm run dev, but when I try to build and deploy it on Vercel, I encounter an error stating that it cannot find the module. However, the module is found without any issues ...

Version 13.5 of NextJS is triggering errors in the GraphQL schema

Ever since I updated to NextJS 13.5, I've been encountering these errors specifically when deploying on Vercel (although everything works fine locally): Error: Schema must contain uniquely named types but contains multiple types named "h". at new GraphQL ...

In the Vercel production environment, when building Next.js getStaticPaths with URL parameters, the slashes are represented as %

I've encountered an issue while implementing a nextjs dynamic route for my static documentation page. Everything works perfectly in my local environment, and the code compiles successfully. However, when I try to access the production URL, it doesn&ap ...

Vercel's nodemailer failing to send emails in production environment

Recently, I encountered an issue with sending emails using Nodemailer in my serverless Next.js project deployed on Vercel. Surprisingly, it works flawlessly in development mode, but fails to send any emails in production mode without giving any error feedb ...

Problem with deploying NextJs on Vercel

I've encountered an issue when trying to deploy to Vercel by pushing code to the main branch since yesterday. Every page on my website (404, homepage, etc.) is displaying a strange error message, even though there are no instances of the useID() hook ...

What sets apart vercel.json from next.config.js when it comes to handling rewrites?

To customize your rewrite settings, you have the option to store them in either a file named vercel.json or the next.config.js file. If you are using Vercel as your hosting provider, is there any noteworthy difference between these two approaches? Are the ...

The Next.js applications hosted on Vercel servers may have distinct process.env.PWD values for static routes compared to dynamic routes

I'm currently utilizing the app router and deploying on Vercel. Within the root of my project, I have a directory named blog where I store markdown files. When accessing them locally, I use: ./blog/a-blog-post.md. This method works well for both dynam ...

Invalid export field 'query' encountered while attempting to deploy NextJS13 and Sanity.io on Vercel

Currently, I am diving into the world of NextJS13 and following a blog tutorial by Sonny Sangha called 'Let’s build a BLOG with Next.js 13 (Sanity v3, TypeScript, Tailwind CSS, Auth, CMS, Preview Mode)'. After completing the tutorial, my goal is to deplo ...

Issue encountered while constructing my application (utilizing the "yarn run build" command and in Vercel)

Encountered an error during the build process, whether on the server or locally. This issue arises when using package managers like yarn, npm, and others. The error specifically points to a problem in the CSS file, but it only occurs in the production bu ...

Error: It is not possible to assign a value to the Request property of the Object since it only has a getter method

Encountering issues while attempting to deploy my Typescript Next.js application on Vercel. The build process fails despite functioning correctly and building without errors locally. Uncertain about the root cause of the error or how to resolve it. The f ...

Setting up a subdomain to point to a Next.js page hosted on Vercel

Can a Vercel subdomain be directed to a next.js page rather than a separate git branch? I attempted to configure a.subdomain.com on my Vercel domain subdomain.com, hoping to display a next.js page, but Vercel insists on pointing to a git branch. While I ...

We regret to inform you that the Serverless Function in NextJs has surpassed the maximum size limit of 50mb

Recently, I've started working with NextJs and encountered an issue while attempting to deploy my project on Vercel. The error message that popped up looked like this: Error! The Serverless Function "api/auth" exceeds the maximum size limit of 50mb, with ...

Setting up a Vercel deployment for a NX Monorepo project with React and Express

https://github.com/clearhost-cmd/helloapp I am facing challenges in deploying my NX Monorepo to Vercel. While the NX Monorepo runs smoothly on localhost without any issues, I'm encountering difficulties getting it to work on Vercel. There are no e ...

What is the process to subscribe and obtain data from a server-to-user channel using pusher-js?

I am currently hosting my application using next.js on Vercel. I want to integrate Pusher to provide real-time messages to users in a private and secure manner. Despite successful log entries, I am facing challenges in subscribing to the channel and retrie ...

Tips for stopping Vercel from deploying the master branch when only the README.md file is modified

Is it possible to push updates for non-critical files like a README without triggering a full project redeployment on Vercel? I know about the Ignored Build Step option, but I'm looking for a way to specifically update certain files. How can this be achi ...

When using Next.js and the getServerSideProps method throws an error, it returns a 404 status code instead of the

I have a simple setup using getServerSideProps with Sentry error logging in Production on Vercel export const getServerSideProps = async () => { // make some API call if(error) { throw new Error("Something went wrong") } return { pr ...

Verify user authentication status on the server using Vercel and NextAuth

After successfully running my blog on localhost, I encountered an issue when deploying it on Vercel. The page to create a post kept returning error 504 with no additional information in the logs. I made sure to update the NEXTAUTH_URL with the URL provide ...

Vercel prevents Google from including website in search results

After deploying my Next.js app on Vercel, I encountered an issue where Google's crawl requests were returning a 401 unauthorized error. This problem is also evident in the deployment logs console as indicated below: Even though I added the URL to the ...

Encountering a 500 error while trying to make a POST request with FastAPI on Vercel

I am currently utilizing React on the frontend and Fastapi on the backend main.py from typing import Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder from fastapi.middleware.cors import CORSMiddleware from pydantic import ...

How can I extend the execution limit for a Server Action in NextJS / Vercel?

Running a Server Action in NextJS14 on Vercel, I've noticed in the logs that the function is timing out: Execution Duration / Limit. 15.01s / 15s (timed out) The OpenAI API call may be causing the delay. Is there a way to extend the time limit for this ...

Positive SWR genetic alteration

I am currently developing a small application that allows users to sign up for karaoke music. To fetch information from a mongoDB, I am using SWR, but facing performance issues. In an attempt to improve the user interface, I am trying to implement optimist ...

I'm sorry, but you can't use objects as a React child (found: [object Promise]). If you intended to display a group of children, make sure to use an array instead. What

I followed a tutorial on YouTube to replicate something for my application. It worked in the tutorial, but now I'm facing an error. The data is being logged in the console, but I can't render it in my Next.js component. I am using PostgreSQL in ...

Strategies for troubleshooting a Next.js hydration issue that exclusively appears during the deployment phase

I am encountering an issue with my Next.js app deployment on Vercel. While running 'next dev', there are no hydration errors, but when deployed to Vercel, the production build displays multiple minified React errors. The challenge I'm facin ...

`fetch` functionality does not function properly when included in middleware page after deployment on Vercel

On a specific route, I have a middleware page that first checks against the backend server. Within this middleware, I am attempting to call a next.js api page using the fetch API, which then communicates with the backend. This process functions correctly i ...

Prevent entry to a specific directory within NextJS

Is there a method to restrict access to the directory in NextJS? For instance, if I wish to prevent access to the directory /public/images? In that case, I would serve images through api routes. So, the image would be displayed in a component like this: & ...

Executing a serverless function in Next.js using getStaticPaths: A step-by-step guide

In my current project, I am utilizing Next.js and the Vercel deployment workflow. To set up page generation at build time, I have been following a guide that demonstrates how to generate pages based on an external API's response. // At build time, t ...

Error encountered while attempting to call `prisma.job.findMany()`: Database path issue occurred when trying to connect to my SQL Lite database on Vercel

Whenever I attempt to access a page that loads data on my next.js application, I encounter a 504 internal server error. The error message reads: Error retrieving users: PrismaClientInitializationError: Invalid `prisma.job.findMany()` invocation: Error qu ...

Encountering the following error message: "ESLint: Unable to locate module path '@vercel/analytics/react' (import/no-unresolved)", despite the package and path being existent within the file

ESLint is throwing an error message that says: ESLint: Unable to resolve path to module '@vercel/analytics/react'.(import/no-unresolved) The issue arises in this line of code: import { Analytics } from '@vercel/analytics/react'; This error occurred while ...

User error: next.js couldn't find the specified resource /api/ on vercel

I am currently working on a Next.js website that I plan to deploy on Vercel. As part of my project, I have created a Next.js API endpoint "/api/contact" which is responsible for sending emails using Nodemailer. The code works perfectly fine when tested on ...

Pages that utilize the `getServerSideProps` function cannot be exported

I seem to be a bit confused here. Based on the documentation, if I want Server Side Rendering (SSR) for the page, I need to export the async function: getServerSideProps However, when I try to build or deploy the project locally or on Zeit now, I encoun ...

Using Cookies with Next.js and Vercel

I am facing an issue with my NextJs app deployed on Vercel where the cookie is not being set. Upon checking the console in Network, I can see that the request returns a 200 status and the set-cookie value is present without any warning. However, when I loo ...

How to redirect in Next.js from uppercase to lowercase url

I'm trying to redirect visitors from /Contact to /contact. However, following the instructions in the documentation results in an endless loop of redirects. This is my attempted solution: // next.config.js async redirects() { return [ { ...

Error message encountered in VercelCLI during the deployment of a Nextjs project: "Connection

I've encountered an issue while attempting to deploy my next.js frontend using Vercel CLI, and I keep getting an error. Here is a screenshot of the error: enter image description here Any suggestions on how to resolve this? My current version of Ver ...

What could be causing the favicon in my Next.js application to not function properly?

My favicon doesn't seem to be working properly. I've saved the favicon file as favicon.ico in the /public directory and have included a reference to it in the <Head> section of my pages (which are located in the /pages directory), but it s ...

Enabled the swcMinify setting to true in Next.js version 12

Recently, I made the decision to remove my babelrc file in favor of the new rust compiler, which is being endorsed by Vercel. However, this change caused my build process to break down. The only content within my babelrc was: { "presets": [&quo ...

We were unable to identify any Next.js version in your project. Please ensure that the `"next"` package is installed in either the "dependencies" or "devDependencies" section

My attempt to deploy a Next app using the Vercel CLI has hit a roadblock. After running vercel build with no errors, I proceeded to deploy with vercel deploy --prebuilt, which also went smoothly. However, when trying to move the project from the preview en ...

I'm encountering a ModuleNotFoundError that says: "Module not found: Error: Can't resolve". What could be causing this

I have encountered an issue while trying to create a blog post page on my NextJS website. The page displays correctly on my local machine, but when I deploy it to production, I am facing the following error and I am unsure of how to resolve it: Here is the ...

After being deployed via Vercel, MongoDB faces connectivity issues with the web

After deploying my web app on Vercel, I encountered an issue where the MongoDB connection was working fine during development but failed to connect after deployment. It was suggested before deployment to reduce the function running time from 300s to 10s du ...

Activate on-demand static regeneration with Next.js

I am thoroughly impressed by the functionality of Incremental Static Regeneration in Next.js. However, I am currently seeking a method to manually trigger static page regeneration as needed. It would be ideal to have a command that can be executed via an ...

Steps to facilitate all CORS API requests in Next.js

I need to set up CORS for my app to allow all sources and destinations. For deploying my Next.js app on Vercel, I am referring to this guide. Here is the content of my next.config.js file. /** @type {import('next').NextConfig} */ const nextConfig = { r ...

Vercel is encountering difficulty locating a module or type declaration during the construction of a Next.js application

Currently, I'm facing an issue while trying to deploy a Next.js app to Vercel. The package react-swipeable appears to have its own type declarations but the build fails with the following error: Running "npm run build" ... > next build ... Failed t ...

React is up and running smoothly on my local machine, but unfortunately encountering issues on Vercel

I have encountered an issue while trying to deploy my website on Vercel. Despite the build logs showing a successful compilation, I am receiving a "failed to compile" error: [16:43:24.951] Running build in Washington, D.C., USA (East) – iad1 [16:43:25.05 ...

Issues with Environment Variables in Vercel NextJS Application

Transitioning from Ruby on Rails to NextJS has been a bit challenging, especially when it comes to understanding how environment variables work on the Vercel platform. I followed the recommendations in the NextJS documentation to set up environment variabl ...

Set up your server on Vercel platform for seamless deployment

Currently, I am following a tutorial by CJ, where he demonstrates deploying his server using now. However, the tutorial is now outdated as now has been replaced with vercel. I am unsure about how to proceed with vercel. Can someone provide guidance on thi ...

Oops! Encountered a NeonDbError 42P07 while trying to configure NextJS DB with Vercel Postgres

After diligently following the guidelines provided by Vercel for setting up Postgres, I encountered an issue when testing my endpoint: { error: { name: "NeonDbError", code: "42P07" } } Below is the code snippet of my endpoi ...

Unable to locate module: Unable to locate the file './Header.module.scss' in '/vercel/path0/components/Header'

I encountered an error while attempting to deploy my next application on Vercel. I have thoroughly reviewed my imports, but I am unable to pinpoint the issue. Module not found: Can't resolve './Header.module.scss' in '/vercel/path0/comp ...

What are the steps to implement vercel OG image in a folder of a next.js app?

I'm struggling to make ImageResponse work as a NextResponse. Specifically, I attempted to implement og image generation using @vercel/og within app/somedirectory/route.js. However, I encountered issues with implementing ImageResponse to be returned as a N ...

Enable next-i18next to handle internationalization, export all pages with next export, and ensure that 404 error pages are displayed on non-generated pages

After carefully following the guidelines provided by i18next/next-i18next for setting up i18n and then referring to the steps outlined in this blog post on locize on how to export static sites using next export, I have managed to successfully generate loca ...

What is the best method for uploading source maps to Sentry from a Next.js project?

Summary: Deploying a next.js application on Vercel Utilizing sentry.io for error monitoring Struggling with setting up source maps correctly Long Form: Significant changes have occurred since the early versions of Sentry (formerly known as Raven). There ...

Running Next.js in AWS Lambda with the `experimental-edge` runtime can be achieved by following these steps

I am currently exploring the possibility of running Next.js (v13.0.6) with OG image generation logic using @vercel/og in AWS Lambda. Everything runs smoothly locally, both in development and production modes. However, I encounter a 500 error when attempti ...

React app experiencing issues with mui icon display upon deployment

I am facing an issue in my app where I am trying to import a mui/icon: import PriceCheckIcon from "@mui/icons-material/PriceCheck"; When running the app locally, the icon appears fine. However, once deployed on Surge or Vercel, the icon does not ...

Troubleshooting Vercel's caching of CORS headers across different domains

I currently have a Next.js API hosted on Vercel that is being utilized by various domains. One issue I'm facing is when the browser sends the If-None-Match header, Vercel replies with a 304 status; however, the Access-Control-Allow-Origin header may conta ...

Encountering a snag while attempting to launch NextJS application on Vercel platform

I've been facing an issue while attempting to deploy my NextJS application on Vercel. The error message I keep encountering is as follows: 19:07:34.256 > Build error occurred 19:07:34.257 Error: Failed to load config "next/babel" to exten ...

Using a custom domain for your NextJS app hosted on Vercel with a Firebase backend

After creating a NextJS App and implementing firebase for authentication and firestore, I purchased a domain from GoDaddy and am currently hosting it on Vercel. Despite everything working as intended, the issue I'm facing is that I cannot seem to add a cu ...

Tips for preventing caching on particular Nextjs API routes

In my Next.js application, I have an API route at /api/auth/signout that is responsible for clearing a specific cookie and returning JSON data. The issue arises when I deploy the project to Vercel - initially, this API route works correctly by clearing th ...

The font '<URL>' was denied from loading due to its violation of the Content Security Policy directive "font-src 'none'"

I am facing a major issue with this persistent error that I can't seem to resolve. *Disclaimer: As a junior, I am still learning the ins and outs of NextJS, so please bear with me if I make any mistakes while asking this question. Currently, I am using t ...

What could be causing the 404 error message in Backend deployment on Vercel?

Hello everyone, I'm currently in the process of deploying the backend for my MERN application on Vercel. Prior to this attempt, I successfully deployed a small todo project using MERN on Vercel. Everything worked fine then, and I followed the same steps f ...

The attempt to deploy my NextJS app to Vercel failed, with the deployment only displaying the message "Compilation Failed."

I'm having trouble understanding why my deployment keeps crashing, as there are no significant error messages, only a bunch of warnings that it should still work (it has worked in the past with these same warnings). Here is the build log: Running bui ...

Challenge with the revalidateTag() function in Next.js app routing and Sanity integration

I have been struggling to integrate the next app router with Sanity and revalidateTag() function. It has been a challenging journey as I tried to make it work for five full days across multiple projects. Here is what I have discovered so far: Project 1: T ...

Challenges encountered while deploying a NextJS project with TypeScript on Vercel

Encountering an error on Vercel during the build deploy process. The error message says: https://i.stack.imgur.com/Wk0Rw.png Oddly, the command pnpm run build works smoothly on my PC. Both it and the linting work fine. Upon inspecting the code, I noticed ...

When I try to make an on-demand revalidation API call on Vercel, it takes so long that it ends up timing

Inspired by Kent C. Dodds, I have created a blog using Github as my Content Management System (CMS). All of my blog content is stored in the same repository as the code, in mdx format. To streamline the process, I set up a workflow that detects changes i ...