-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
[Probs a bug] Totally empty sitemap? Lol? #705
Comments
Having the same issue, I thought it's my issue (missing some config) until I see this. Will wait for the inputs here. |
Up this, I have the same issue as well |
Empty sitemap here as well |
For me it is just happening with the new |
idk why, but it was initially working fine on my project, using the app directory. :/ |
Empty sitemap as well |
When can we expect any comment or progress on this issue? We currently have to resort to maintaining the Sitemap manually which is quite cumbersome given that most of our pages are generated based on CMS content. |
Hmmm... It seems that there is a lot more informations in the Maybe Next-Sitemap was designed to work with Static generation, but not with the SSG one. |
ping @iamvishnusankar |
Lol. I've done some changes in the architecture of my project, and now the sitemap generation came back. Created a new branch, in addition of https://github.com/Tirraa/dashboard_rtm/tree/next-sitemap-empty-sitemap-issue Hope it would help to investigate. |
same issue here. Pages marked as Static during the build are in sitemap, but SSG not. |
Idk why, but I have the impression that if you have a minimum of one "Server" page (nor SSG, nor Static), things go back to normal? Could someone try creating a dynamic path [stupidworkaround] and putting in an empty page that just returns a div? Just to see. If it works, you might as well create a dynamic path [notfound] and just put a 404 page into it, in a place where it's not a nuisance to do so. |
I have pages of all kinds in my build (two server side and two static) - still doesn't work. |
Hmm, that's curious. Does your
|
Yup, with one more:
|
I'm in the same boat, I've tried and tried but I can't get my sitemap to generate all the static paths, also on nextjs13 |
Facing the same issue. |
I think it might be related to this issue : #692 |
Could also be this: #700 |
Same issue |
I had it working for some time without any issue. And today it decided to not work anymore as mentioned by everyone here. In case someone really stuck with it, I've migrate to the official, took me 20 minutes and its smooth. |
in my case it was related to this: #692 |
I have one project having issues with sitemap on app router while others works fine, it was driving me crazy, I compared versions and downgraded to 4.1.8 and it seems to be working now. This library seems a little abandoned? The oficial sitemap support from nextjs is very basic, how do you even generate sitemaps for static pages generated at build time @agonist ? |
It depends on how you generate your static page, but on my side, I generate page based on data from my db, so I'm simply generating my sitemap based on the same data I use to generate static page.
I'm doing something like that. So I have various array of from my static pages for different routes. once setup you don't have to touch it anymore and what's happening is very predictable which make the sitemap less mysterious and give you full control over it. and adding a single regular page just take 10 seconds which is find. |
thanks for the suggestion, I kinda liked how this library used to "just works", but I think it's worth doing some refactoring to use the built in support from nextjs and get more predictable results, I wrote a function to map the static pages from the filesystem, now I just need to include pages generated at build time. |
I'm using Next 14 with the pages folder and I'm getting empty sitemaps too. No errors. |
Getting empty sitemaps even exporting |
you must first build the project, since the library interacts with the .next folder.
|
I'm using Next.js 14 and experiencing the same issue. |
On my side, I had a root layout (on a approuter next.js 14), and when importing |
This makes the whole package unusable and there are basically no alternatives around bar manually maintaining a sitemap, which is not acceptable. Nextjs itself pretty much did not go any further than making manual generation easier because this package exists, so it needs to work. #692 needs to be reopened: it's a very current bug and the ticket was closed automatically because it was ignored. Such a small thing can't make the package entirely useless for so many users. |
I got the same bug with next.js 14, currently I was manually code sitemap |
I worked around this in my case by removing my |
Same problem in nextjs 14. |
I'm using Next.js 14 and experiencing the same issue. |
Sounds similar to #812. |
Currently it's quite useless for me to use this library in next 14 using app router. I'm able to generate static pages using const globby = require('globby')
const basePath = process.env.NEXT_PUBLIC_URL
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: basePath,
generateRobotsTxt: true,
async additionalPaths(config) {
// get all static pages
const globResult = await globby(['app/**/!([.*])/page.tsx'])
const now = new Date().toISOString()
const pages = globResult
.filter((e) => !e.includes('['))
.map((e) => e.replace(/^app/, '').replace('/page.tsx', ''))
.map((e) => new URL(e, basePath).toString())
.map((loc) => ({
loc,
lastmod: now,
changefreq: config.changefreq,
}))
return [...pages]
},
async transform(config, path) {
const loc = new URL(path, config.siteUrl)
return {
loc: loc.toString(),
changefreq: config.changefreq,
lastmod: config.lastmod,
}
},
} and since edit: i got the code for fetching static pages from here |
Closing this issue due to inactivity. |
Hello.
I'm using Next.js 13 with the App Router.
I know that next-sitemap can generate good sitemaps files with this setup.
I've already done this in my current (and first Next.js) project.
I'm doing my best with
generateStaticParams
, and have an exhaustive output of my paths when I build my Next project.Output of
yarn build
:Here is
sitemap.xml
:(yah, I'm crying)
Moreover, here's the disaster:
As I'm a bit of an idiot (lol), I tend to use the
git commit --amend
command a lot and I totally lost the original code which was somehow "compatible" (?) with next-sitemap, and which was not generating empty sitemaps.To be honest, I don't have the courage, nor the knowledge, to understand what's happening to take me from a correct sitemap generation to a totally empty one. ( :'( )
I've made a branch to help you to reproduce and investigate.
https://github.com/Tirraa/dashboard_rtm/tree/next-sitemap-empty-sitemap-issue
Warm regards. ( I'm so sad to have an empty sitemap. :'( )
The text was updated successfully, but these errors were encountered: