Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ BUG ] Missing </sitemapindex> tag when using createSitemapsAndIndex #286

Closed
thathurtabit opened this issue Apr 10, 2020 · 2 comments
Closed

Comments

@thathurtabit
Copy link

Describe the bug
Using createSitemapsAndIndex generates an xml file, but seems to be missing the closing </sitemapindex> tag, causing xml to be invalid.

Expected behavior

createSitemapsAndIndex({
    hostname: URL,
    targetFolder: TARGET_FOLDER,
    gzip: false,
    sitemapName: 'sitemap',
    urls: [...],
});

Should generate:

<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://fretmap.app/sitemap-0.xml</loc></sitemap></sitemapindex>

But instead generates the above, without the closing </sitemapindex>

Context:

  • Library Version "sitemap": "^6.1.0",

Additional context
Great work though!

@ruiwei
Copy link

ruiwei commented Apr 11, 2020

Chrome error: "error on line 1 at column 179: Extra content at the end of the document".
/lib/sitemap-index-stream.ts
Line 75: looks like this did not call

derduher added a commit that referenced this issue Apr 13, 2020
@derduher
Copy link
Collaborator

This has been patched and released. Pleased be advised createSitemapsAndIndex is deprecated and will be removed in the next major version. I recommend moving to SitemapAndIndexStream https://github.com/ekalinin/sitemap.js/blob/master/api.md#sitemapandindexstream. Please feel free to open a ticket if documentation is not clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants