I'm experiencing a problem in generating the sitemap. Everything works fine on localhost and the sitemap is generated properly but when I deploy my code to Heroku it stops working and I get this error (both on staging and production):
ERROR Cannot read property 'get' of null at handler (node_modules/@nuxtjs/sitemap/src/index.js:117:13) at call (node_modules/connect/index.js:239:7) at next (node_modules/connect/index.js:183:5) at next (node_modules/connect/index.js:161:14) at SendStream.error (node_modules/serve-static/index.js:121:7) at SendStream.emit (events.js:182:13) at SendStream.EventEmitter.emit (domain.js:442:20) at SendStream.error (node_modules/send/index.js:270:17) at SendStream.onStatError (node_modules/send/index.js:421:12) at onstat (node_modules/send/index.js:727:26) at FSReqWrap.oncomplete (fs.js:152:21)
So this would be in this file: https://github.com/nuxt-community/sitemap-module/blob/dev/src/index.js. And I guess it has something to do with the cache not being created?
I've removed all the settings and custom routes from the module so it's just included with this piece now:
modules: [ ...more modules... ['@nuxtjs/sitemap'], ...more modules... ]
I've tried reproducing this error with a blank nuxt installation with just this module deploying to heroku but with no success (as in, a sitemap is properly generated). The problem is probably somewhere in my codebase but I'm not sure where to start looking.
Any idea where I should start to solve this error?