Nuxt.js Internal Server Error when using @nuxtjs/sitemap
See original GitHub issueHi,
I am using @nuxtjs/sitemap
in my project which is working perfectly in dev environment but after deploying to now when I visit mysite.com/sitemap.xml I see Nuxt.js Internal Server Error
on the browser and on the Zeit Now Runtime Log I see:
ERROR Cannot read property 'map' of null
at joinRoutes (node_modules/@nuxtjs/sitemap/lib/cache.js:76:31)
at AsyncCache.load [as _load] (node_modules/@nuxtjs/sitemap/lib/cache.js:19:18)
Duration: 7.37 ms Billed Duration: 100 ms Memory Size: 3008 MB Max Memory Used: 238 MB
I have Googled a lot but couldn’t find any solution to this. Can anyone please help?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Nuxt Sitemap Internal Server Error on Vercel - Stack Overflow
I want to create a sitemap for my SSR Nuxt project. I'm using the '@nuxtjs/sitemap' module for creating my sitemap.
Read more >Sitemap.xml on a Nuxt site - Issues - Edgio Community Forums
Deployed a nuxt site to the XDN and trying to serve my sitemap, receiving the following error: None of the specified routes in...
Read more >Nuxt.js Dynamic Sitemap and Feed for Static Websites - Medium
I have a portfolio website that has blog pages and other common things that a website has. When using CMS like WordPress or...
Read more >Change the Nuxt.js server error page - Alexander Lichter's blog
No problem! You can do this through your nuxt.config.js . The text for the default error pages is extracted from the message object....
Read more >Nuxt Sitemap Module: Introduction
Module based on the awesome sitemap.js package ❤️. Create sitemap or sitemap index. Automatically add the static routes to each sitemap.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nuxtjs/sitemap module writes sitemap-routes.json file into nuxt dist directory during build process:
But currently nuxt`s now-builder ignores external files outside ‘client’ and ‘server’ folders. So you have to add path to sitemap-routes.json manually.
@isaumya Just add
"./.nuxt/dist/sitemap-routes.json"
to serverFiles array in your now.json config file than your issue will be fixed:In case you use custom buildDir, use
"./YOUR_BUILD_DIR/dist/sitemap-routes.json"
instead.@MarvinMiles Thank you so much for looking into this and providing the solution. I have just now tested and can confirm that the sitemap is running perfectly and not returning any
Internal Server Error
. Thanks again for the help. 😊