Skip to content

fix: Vercel Edge functions stop working when sitemap or robots is installed in Nuxt 4 #511

@Syourt

Description

@Syourt

🐛 The bug

View https://nuxt-vercel-api-issues.vercel.app/api/test for the error message.

This is what the Vercel Logs give me, not much:

Image

My reproduction can't be made in Stackblitz as it would not use Vercel Edge Functions to do the api calls. I have added a reproduction in Github which can be used in Vercel.

🛠️ To reproduce

https://github.com/Syourt/nuxt-vercel-api-issues

🌈 Expected behavior

The API should return { message: 'api works' }

ℹ️ Additional context

These modules have been working fine for months in my Nuxt 3 environment. Now I'm upgrading to Nuxt 4 and within Vercel the API calls suddenly stop working. After disabling my modules I found out it was coming from @nuxtjs/sitemap and @nuxtjs/robots. Could be the other SEO plugins cause these issues aswel but I haven't tested it.

I really want to upgrade to Nuxt 4 but since the robots and sitemap modules are also required for my websites I'm kinda stuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions