Questions tagged [vercel]

Vercel is the platform for frontend developers. Vercel has zero-configuration support for 35+ frontend frameworks and integrates with your headless content, commerce, or database of choice.

Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.

They enable teams to iterate quickly and develop, preview, and ship delightful user experiences. Vercel has zero-configuration support for 35+ frontend frameworks and integrates with your headless content, commerce, or database of choice.

2631 questions
5
votes
1 answer

Vercel ignore build step according to folder of committed files

i'm using vercel's ignore build step field to disable preview deploys (IE - only deploy if the branch is main) I'm doing this with the following bash script: if [[ "$VERCEL_GIT_COMMIT_REF" == "main" ]] ; then # Proceed with the build echo "✅ -…
Uri Klar
  • 3,800
  • 3
  • 37
  • 75
5
votes
0 answers

Vercel Edge Functions works locally and give 404 on production when trying to work with 'hostname-rewrites'

I'm trying to work with the new edge functions from Vercel next.js and it's not working on production, always gives a 404 error. I followed this example and nothing works. maybe because I'm using i18n? my _middleware.js file looks like this: import…
Avichay Dahan
  • 79
  • 1
  • 4
5
votes
2 answers

Can not use serverSideTranslations on Vercel

In my index page i'm using serverSideTranslations function. getting error about finding file of translation. this error happens only on pages that used by serverSideTranslations. I deployed to Vercel and Netlify. in both of them i'v got the same…
Nadav Avisror
  • 153
  • 1
  • 8
5
votes
4 answers

NextJS / vercel - 504 Error 'FUNCTION_INVOCATION_TIMEOUT'

Getting this error on one of my pages after deploying to vercel, it all works fine in dev mode. I think the problem might be one of my fetch/APIs since it uses the data from the first fetch request as the URL for the second fetch request... All of…
Liiaam93
  • 195
  • 1
  • 2
  • 10
5
votes
1 answer

Vercel deploy / build fail. "Failed to compile. Type error: Cannot find module ... or its corresponding type declarations

I'm trying to deploy my first Next.js app using Vercel. Even though my app runs fine on my local machine (I mean, it builds locally with yarn run build and I'm also developing normally when using yarn run dev), my build/deploy on Vercel is…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
5
votes
2 answers

Vercel old preview deployments

I really like to deploy apps on Vercel. I do however wonder how one is supposed to deal with all the preview deployments that inevitably will get created. Are you supposed to delete them yourself? Is there a way to automate deletion of preview…
Fabian Bosler
  • 2,310
  • 2
  • 29
  • 49
5
votes
1 answer

Add post-build script to next.js on Vercel?

Is this supported somehow? I'd like to execute arbitrary code to post-process the built HTML/css/etc after next.js does its thing.
Joren
  • 9,623
  • 19
  • 63
  • 104
5
votes
1 answer

Can you use nextjs image component with canvas

I am creating an image scroll component like the Apple Airpods Pro website. For this, I am using up to 750 for each iteration of this component. I need to draw the images onto a canvas, currently, I am using the standard JS - new Image() function to…
Aiden Barrett
  • 329
  • 1
  • 4
  • 11
5
votes
0 answers

Vercel Node Serverless fails to import ES6 module (vercel dev locally works fine)

I get this error when accessing an API endpoint in a Vercel deployment of a React app with a top level api/ folder containing serverless endpoints. Interestingly, this API endpoint works fine locally using vercel dev. Even more interestingly, a…
Madhav Jha
  • 863
  • 1
  • 8
  • 26
5
votes
0 answers

Implement next js Optional catch all routes without deleting index.js

How can I implement Next js feature Catch all routes [[...slug.tsx]] (https://nextjs.org/docs/routing/dynamic-routes#optional-catch-all-routes) without deleting the index.js page? If I don't delete it, I get this error: Error: You cannot define a…
user13680445
5
votes
1 answer

Is it possible to serve different versions of a static page with nextjs on vercel according to useragent (device type)?

The nextjs page /users/[userid] is statically rendered on build time in the vercel platform. Is there anyway to serve two different versions of that page through some configuration on vercel or nextjs according to the user-agent (device-type) ?…
Ismael
  • 358
  • 3
  • 15
5
votes
1 answer

How does Next.js basePath works for images?

I'm trying to add a basePath to my next.config.js, it works well for the website content. But all the images are broken. // next.config.js module.exports = { basePath: '/my-sub-url', assetPrefix: '/my-sub-url/' } I also tried adding all the…
pizza0502
  • 313
  • 6
  • 21
5
votes
2 answers

How can I setup proxy using Vercel

My API it's running under another domain.. and I'm trying to configure proxy with Vercel .. The app it's making requests to /api/test.json so I tried to... on vercel configuration "redirects": [ { "source": "/api/test.json", …
ridermansb
  • 10,779
  • 24
  • 115
  • 226
5
votes
2 answers

process.env.URL null in nuxt project onvercel

I am deploying nuxt app on vercel. I added a secret to vercel environment following this guide - https://vercel.com/docs/environment-variables#secret-environment-variables Locally I am using dotenv and it is working well, loading the variable from…
Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122
5
votes
2 answers

How to improve font loading/caching with Vercel/Next.js?

I use custom fonts on a website. It works, but it looks like they aren't cached long enough, as I way too often get FOUT. Some times multiple times a day, on production. I'm hoping I can cache fonts for a longer period (or another solution) to…
eivindml
  • 2,197
  • 7
  • 36
  • 68