fedeya/remix-sitemap

Regression bugs after updating from 2.2.1 to 2.2.6

kgkg opened this issue · 2 comments

kgkg commented

Describe the bug
After updating remix-sitemap from 2.2.1 to 2.2.6 and refreshing runtime generation of sitemap.xml there 2 differences since version 2.2.1.

  1. entry for index path (http://localhost:3000) is missing
  2. paths like _layout.contact.tsx without exported sitemap const used to be generated properly like http://localhost:3000/contact. After update they're being generated as http://localhost:3000/undefined/contact.

To Reproduce
Steps to reproduce the behavior:

  1. Create routes/_layout.tsx with content (not sure if this is nessesasary)
export default function LayoutWithData() {
    const outletData = useOutletContext<{}>();
    return (
        <div>
            <Outlet context={outletData} />
        </div>
    );
}
  1. Create routes/_layout._index.tsx with any component code.
  2. Create routes/_layout.contact.tsx with any component code.
  3. Initialize sitemap in entry.server.tsx as described in remix-sitemap docs.
  4. Open sitemap.xml

Expected behavior
In generated sitemap there should be entry for main path and correct entries for top-level routes.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS latest
  • Firefor/Chrome latest

Additional context
Add any other context about the problem here.

fedeya commented

Hi @kgkg, the new releases fix some issues with complex nested routes, but i forgot to handle the pathless routes.

I released a new version (2.2.7) trying to fix this problem, could you try again?

Thanks!

kgkg commented

Hi @fedeya, thanks for the patch - I compared both sitemaps and all seems to work great 👍