[NUXT] Deployment error: should NOT have fewer than 1 properties

Hello there, I would like to switch from Netlify to Vercel (because the time to first byte with Nuxt in SSR mode is way too long: about 4 seconds…) So I’ve configured my Vercel account with the right Nuxt Platform Preset (build: pnpm run build, output: dist), and set the NITRO_PRESET env as vercel.

But when i try to deploy, I have this build error (that i don’t have on localhost or netlify): Error: Builder returned invalid routes: should NOT have fewer than 1 properties

I’ve tried many things with the Vercel AI assistant (forceSSR: true in nuxt.config.ts, add / route in nitro.prerendered, changing node version etc… but still the same issue.

Have you already seen this problem with Nuxt?

Project id: prj_SzBUtNC3uMfV8wBAFJ9QmImUY7q5
Nuxt version: 3.19.0
Node version: 22.x

Thanks for your help!

You shouldn’t need to set NITRO_PRESET or the output directory - you can leave that blank. Have you configured anything else, such as a custom vercel.json or configuration in your Nuxt config file?

Finally, given what you want, do you want a static generated site (nuxt generate) or an SSR/hybrid app (nuxt build)?

Hello Daniel*, and thanks for your reply!

I don’t have a vercel.json, and there’s nothing specific to Vercel in my nuxt.config.ts.
I removed the NITRO_PRESET environment variable and tried a new deploy, but the issue persists.

I want SSR because my pages are dynamically generated from a database and cannot be static.

Everything works as excepted with Netlify, but I can’t understand why the time to first byte is so long (example: https://osso.labandotheque.fr), so I wanted to give Vercel a try.

Do you need more details about my config?

Thanks for your help!

* I didn’t expect you to respond directly, but I just wanted to take the opportunity to say that I’m a big fan of your work :slight_smile:

1 Like

How strange. Do you have a public repo? Can you reproduce minimally? I’d happily take a look.

And thanks for the kind words :blush:

1 Like

I finally found the reason,
It was because of this in my nuxt.config.ts:

nitro: {
    routeRules: {
      "/**": {
        headers: {}, // <-- this object should not be empty for Vercel
      }
    }
  }

I can’t remember why, but put an empty {} in headers was necessary to enable something in Nitro, like a {} in .prettierc to enable formatting.

So I just added a property in the headers object, and now it’s working.

Since it’s not an issue on Netlify but it is on Vercel, maybe we should report it to Vercel or handle this specific Nuxt warning when deploying there?

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.