Deployment blocked by "export const dynamic" error on sitemap.xml with output: export

Deployment blocked: “export const dynamic” not configured on /sitemap.xml with output: export
I’m experiencing a persistent deployment error that’s blocking my project from building, even after reverting to previous commits.
Environment:

  • Framework: Next.js with output: ‘export’
  • Deployment: Vercel
  • Build tool: v0.app
    The Error:

My Setup:

  • Static sitemap.xml file in /public/sitemap.xml
  • next.config.js has output: 'export' configured
  • No dynamic sitemap files exist in /app (confirmed by search)
  • Using v0.app to generate/manage the project
    What I’ve Already Tried:
  1. Cleared .next and .vercel directories
  2. Reverted to multiple previous commits - error persists
  3. Verified there are NO files: app/sitemap.ts, app/sitemap.js, app/sitemap.xml/route.ts
  4. v0 AI assistant confirmed no dynamic sitemap generation exists
  5. Added configuration changes suggested by support - didn’t help
  6. Vercel support said to clear cache and redeploy - error still occurs
    Build Logs Show:
    The error references: .next/server/app/sitemap.xml/route.js:5:3 - which is generated automatically during build, not a file I created.
    The Core Issue:
    Next.js is auto-generating a dynamic route handler for /sitemap.xml that conflicts with output: export, but I only have a static sitemap.xml file.
    Has anyone encountered this? Any solutions would be greatly appreciated!
    Thanks,
    Omar

Hi @amatoomar-6963, welcome to the Vercel Community!

Can you remix the chat and see if the new chat still has this issue?

Hi @amatoomar-6963, I wanted to follow up regarding the deployment issue you reported with the “export const dynamic” error on your sitemap.xml. Have you had a chance to find a solution, or do you still require assistance? If you need help, could you provide the following details?

  1. Have you made any recent changes to your next.config.js?
  2. Are there any other routes or configurations in your project that might conflict with static export?
  3. What version of Next.js are you currently using?

Looking forward to your response.