You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement sitemap for my react app. I am new to react and babel. I have followed through the example given. Everything seems to work just fine. However, for some reason, the sitemap.xml isn't generated at all in the specified folder. File permissions used to be fine. I am wondering why this is the issue.
yarn sitemap
yarn run v1.21.1
warning ../package.json: No license field
$ babel sitemap-builder.js
"use strict";
require("babel-register")({
presets: ["es2015", "react"]
})
var Sitemap = require('react-router-sitemap').default;
var router = require('./router').default;
function generateSitemap() {
return new Sitemap(router).build('http://localhost:3000').save('./public/sitemap.xml');
}
generateSitemap();
Done in 0.95s.
The text was updated successfully, but these errors were encountered:
Problem fixed by myself. Had to do with babel setup. First had to change the "sitemap": "babel sitemap-builder.js" to "sitemap": "babel-node sitemap-builder.js" and deleted the .babelrc file! Script is now being executed instead of simply being shown.
I am building a blog website where i am fetching data from my API you can see on picture
I am running react-router-sitemap and I did exactly same as mentioned in above chat. still I got this error of unexpected token
I am building a blog website where i am fetching data from my API you can see on picture I am running react-router-sitemap and I did exactly same as mentioned in above chat. still I got this error of unexpected token
help me resolving this please
I'm getting the exact issue, i.e, The Issues caused by Spread Operator :'( :'(
I am trying to implement sitemap for my react app. I am new to react and babel. I have followed through the example given. Everything seems to work just fine. However, for some reason, the sitemap.xml isn't generated at all in the specified folder. File permissions used to be fine. I am wondering why this is the issue.
//router.js
// sitemap-builder.js
//package.json
//.bashrc file
//yarn sitemap output
The text was updated successfully, but these errors were encountered: