ERROR: generating sitemap.json

Hi there, hopefully someone can help get this right.

I’m new to Sage and have installed it using a fresh copy of wp on a local environment where I’m using MAMP.

Everything seems to work fine except when I tried to follow the steps in this thread:

My sitemap.json doesn’t get generated properly, instead it states:
`

301 Moved Permanently

Moved Permanently

The document has moved here.

`

the only change in directory I’ve made is the one in manifest.json so that I can use browsersync:
"config": { "devUrl": "http://localhost/roots" }

I added WP_ENV in wp-config.php since it seems to be required:
define('WP_ENV', 'development');

when I visit: http://localhost/roots/?show_sitemap I get a sitemap in json:
[ "http://localhost/roots/index.php/2015/11/17/hej-varlden/", "http://localhost/roots/index.php/exempelsida/" ]

Doing gulp --production works fine having line 105-109 commented out in gulpfile.js.

I would really appreciate it if someone could help getting me on the right track here. :pensive: Thanks!

I just tried with a fresh copy and I get the same error. Maybe I am missing something in the installation process?

I already have gulp & bower globally installed and this is what I did (using OS X)

1, Installed a fresh copy of Wp 4.3.1 and connected it to a localhost db in MAMP environment.
2, Cloned sage/roots github repo into a theme and activated it.
3, Added define(‘WP_ENV’, ‘development’); to wp-config in the root folder.
5, changed the “config” section in manifest.json to “devUrl”: "http://localhost/roots"
4, npm install in the themes folder
5, bower install in the themes folder

After that, running gulp or gulp --production worked fine. But when I did the steps @cfx provided, I got the same end result as previously. What am I missing? :sweat:

I just installed a vagrant box using ubuntu and did the same procedure there.

This time, I get a full sitemap in sitemap.json, but I get the same error. Anyone…?

I would really appreciate if someone could at least try to help…

@newton did you solve this?

I had same problem. But when I changed sitemap function to this one:


and set launchctl limit maxfiles 65536 65536 and ulimit -n 4096
then uncomment lines 105-109 in gulpfile.js,
run gulp --production
next comment those lines run gulp --production again,
the problem solved, everything works fine.

I’m having the same issue on Windows / Xampp. Could you please explain that line ?
Thank you !

Hello,

Did anyone get this to work. I’ve followed the steps and get the below error;

Message:
Cannot find module './sitemap.json’
Details:
code: MODULE_NOT_FOUND

Thanks, Stephen