vercel / vercel/next.js

Sitemap rendering broken on NextJS 15 with edge runtime

Open
#75,174 5 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Output
Dominant language
JavaScript
Stars
142k
Forks
32.5k
Avg merge
2d 13h
Merged PRs (30d)
334

Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/cranky-https-7mqs67

To Reproduce

Error:

15:44:40.872 | ▲  ⚠ Using edge runtime on a page currently disables static generation for that page
15:44:41.910 | ▲  [Error: Failed to collect configuration for /sitemap/sitemap/[__metadata_id__]] {
15:44:41.910 | ▲  [cause]: [Error: Edge runtime is not supported with `generateStaticParams`.]
15:44:41.911 | ▲  }
15:44:41.914 | ▲  > Build error occurred
15:44:41.919 | ▲  [Error: Failed to collect page data for /sitemap/sitemap/[__metadata_id__]] {
15:44:41.920 | ▲  type: 'Error'
15:44:41.920 | ▲  }
15:44:42.040 | ▲  Error: Command "npm run vercel-build" exited with 1

The sitemap MUST be edge-based - I don't want to statically-generate all my existing content.

Current vs. Expected behavior

I expect to run all my sitemaps as dynamic edge functions as I could in NextJS 14. At the moment I can't even get past the build stage - this is the only thing remaining to bring me from Nextjs 14 to 15.

Provide environment information

Cloudflare Next on Pages

Which area(s) are affected? (Select all that apply)

Output (export/standalone)

Which stage(s) are affected? (Select all that apply)

Other (Deployed), next build (local)

Additional context

This build error occurs locally also. For now I've tried to use static generation but cloudflare pages also fails on this step as the database url isn't provided from the environment on build to the build step. Weird. Still, this is a regression IMHO.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and run the reported npm run vercel-build command, then compare the behavior with the stated Next.js 14 setup. Investigate the build failure for /sitemap/sitemap/[metadata_id] and the generateStaticParams edge-runtime error. Done means dynamic edge-based sitemaps build locally and deploy on Cloudflare Pages without requiring static generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.