next-sitemap icon indicating copy to clipboard operation
next-sitemap copied to clipboard

undefined/sitemap.xml undefined/sitemap-0.xml

Open Kawan-edres opened this issue 2 years ago • 9 comments

when npm run build and npm run post build i get the result of undefind and i provided my siteUrl. here my files are :

next-sitemap.config.js /** @type {import('next-sitemap').IConfig} */

const config = { siteUrl:"https://devspace.krd"||process.env.SITE_URL, generateRobotsTxt: true, // (optional) // ...other options outDir : "./out",

}

And here its my package.json data

"scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", "postbuild": " next-sitemap --next-sitemap.config.js" },

Kawan-edres avatar Aug 22 '22 08:08 Kawan-edres

You are using wrong syntax.

This is the correct one: "postbuild": "next-sitemap --config next-sitemap.config.js"

yvikasofficial avatar Aug 22 '22 16:08 yvikasofficial

image I used your syntax too but again it does not fixes my problem

Kawan-edres avatar Aug 23 '22 08:08 Kawan-edres

image

Kawan-edres avatar Aug 23 '22 08:08 Kawan-edres

and this is my next-sitemap.config.js image

Kawan-edres avatar Aug 23 '22 08:08 Kawan-edres

@Kawan-edres Can you provide a basic reproduction?

iamvishnusankar avatar Aug 23 '22 09:08 iamvishnusankar

Thanks for your response , but what do you mean by reproduction , I did build my web page again do you mean rebuild or what ?

Kawan-edres avatar Aug 23 '22 14:08 Kawan-edres

Almost likely you are passing undefined to siteUrl. Check that you have properly set up your .env files and you are passing the right one.

magoz avatar Sep 03 '22 15:09 magoz

and this is my next-sitemap.config.js image

Hello there. it seems like you are not exporting your config yet? you can try to export it by adding this code below your config variable module.exports = { ...config };

desmon91 avatar Sep 08 '22 06:09 desmon91

and this is my next-sitemap.config.js image

Hello there. it seems like you are not exporting your config yet? you can try to export it by adding this code below your config variable module.exports = { ...config };

Thanks a lot it fixes my problem I appreciate your answer

Kawan-edres avatar Sep 08 '22 08:09 Kawan-edres

Closing this issue due to inactivity.

github-actions[bot] avatar Mar 06 '23 04:03 github-actions[bot]