DEV Community

Kamiswara Angga W.
Kamiswara Angga W.

Posted on • Updated on

Deploy Nuxt to Vercel

Having trouble deploying Nuxt JS application to Vercel? Yes, me too. Here's how I deploy Nuxt JS to Vercel. This method is still running on February 1, 2022. Maybe in the future the method of deploying Nuxt applications on Vercel will change and this method can no longer be used.

1. Create a file called vercel.json in the project root

This is the contents of the code from the vercel.json file:

  "version": 2,
  "builds": [
      "src": "nuxt.config.js",
      "use": "@nuxtjs/vercel-builder"
Enter fullscreen mode Exit fullscreen mode

2. Login to Vercel, then click New Project

After logging in, you will be redirected to a kind of dashboard page. Click the New Project button to create a new project.

Vercel New Project button

3. Import project from Git repo

Find your project and click Import. I think this is the easiest way to import our project.

Vercel Import project button

4. Configure Project

Vercel can automatically detect what technology / framework we are using in FRAMEWORK PRESET. In the Configure Project section, click Build and Output Settings.

Vercel Configure Project

5. Build & Development Settings

Change OUTPUT DIRECTORY to .nuxt/dist by clicking OVERRIDE on the right.

Vercel Build & Development Settings

6. If you prefer yarn

If you prefer to use yarn, change it to something like this. Click Save, and you're done. Just wait, later your application can be accessed via the URL provided. Usually it will be quick or takes at most 24 hours.

Yarn Deployment Vercel

7. That's all

Deploying for free on Vercel is useful for testing our application or just want to show our client the appearance or UI.

Thanks for reading.

Top comments (5)

_udemezue profile image
udemezue John

Thanks for this post, but I get these errors, please help me

anggakswr profile image
Kamiswara Angga W.

what nuxt version do u use? cause i use nuxt 2

leerob profile image
Lee Robinson

Hey there! Good news, Nuxt on Vercel is now fully zero-configuration, including Nuxt 3:

_udemezue profile image
udemezue John

Hello, check out this link in stack overflow

arnon profile image
Arnon Rodrigues

Great post!