qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[🐞] Custom `/sitemap.xml` route gets removed when building for production

Open DustinJSilk opened this issue 2 years ago • 0 comments

Which component is affected?

Qwik City (routing)

Describe the bug

Up until recently, its been possible to have a custom /sitemap.xml by creating a sitemap.xml folder with an index.ts file and an onGet function to return the xml data.

This works for dev and preview builds but is removed and returns an empty sitemap when built for production.

This breaks SEO rankings completely if you're using a sitemap

I can only assume there's a clash between the static site generators sitemap and qwiks potentially?

Reproduction

https://github.com/DustinJSilk/qwik-issue-sitemap

Steps to reproduce

Run these to see an empty site map:

  • pnpm i
  • pnpm build
  • node server/entry.cloud-run.js
  • Visit http://localhost:8080/sitemap.xml in your browser

System Info

N/A

Additional Information

No response

DustinJSilk avatar May 02 '23 10:05 DustinJSilk