react-router-sitemap
react-router-sitemap copied to clipboard
Cannot resolve module 'fs'
ERROR in /react-router-sitemap/index.es5.js Module not found: Error: Cannot resolve module 'fs' in .../node_modules/react-router-sitemap @ ./~/react-router-sitemap/index.es5.js 1:7097-7110
ERROR in /sitemap/index.js Module not found: Error: Cannot resolve module 'fs' in .../node_modules/sitemap @ ./~/sitemap/index.js 14:9-22
ERROR in /sitemap/lib/sitemap.js Module not found: Error: Cannot resolve module 'fs' in .../node_modules/sitemap/lib @ ./~/sitemap/lib/sitemap.js 10:9-22 500:12-25
@vadimgubin how you start script for build sitemap?
I added
import "babel-register"; import Sitemap from 'react-router-sitemap'; ..... new Sitemap(Router) .build('http://my-site.ru') .save('./sitemap.xml');
into index.js my app. App build with webpack
@vadimgubin script working in browser or server?
on server when building app
@vadimgubin very interesting) I will check today
@vadimgubin I tested locally, and did not receive such errors. Can you create repository where your problem is reproduced?
I'm getting the same issue with this. I think it's likely to do with https://github.com/kuflash/react-router-sitemap/blob/master/lib/index.js having import fs from 'fs';
but fs
not being listed as a dependency. @kuflash maybe you have fs
installed globally?
@kylerc fs
it's nodejs module. Maybe it can be replaced by something else
Ya... looks like https://github.com/josephsavona/valuable/issues/9 was actually the issue. Fixed it for me at least. @vadimgubin give that a shot.
Hey,can I use this plugin for vuejs??? Or Please help me,If you have any suggestion about vuejs sitemap. Thank you
@sonal241 hey! Please create new issue for discuss this question.