Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve module 'fs' #40

Open
vadimgubin opened this issue Dec 5, 2016 · 11 comments
Open

Cannot resolve module 'fs' #40

vadimgubin opened this issue Dec 5, 2016 · 11 comments

Comments

@vadimgubin
Copy link

vadimgubin commented Dec 5, 2016

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

@kuflash
Copy link
Owner

kuflash commented Dec 5, 2016

@vadimgubin how you start script for build sitemap?

@vadimgubin
Copy link
Author

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

@kuflash
Copy link
Owner

kuflash commented Dec 5, 2016

@vadimgubin script working in browser or server?

@vadimgubin
Copy link
Author

on server when building app

@kuflash
Copy link
Owner

kuflash commented Dec 5, 2016

@vadimgubin very interesting) I will check today

@kuflash
Copy link
Owner

kuflash commented Dec 5, 2016

@vadimgubin I tested locally, and did not receive such errors. Can you create repository where your problem is reproduced?

@kylerc
Copy link

kylerc commented Dec 8, 2016

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?

@kuflash
Copy link
Owner

kuflash commented Dec 8, 2016

@kylerc fs it's nodejs module. Maybe it can be replaced by something else

@kylerc
Copy link

kylerc commented Dec 8, 2016

Ya... looks like josephsavona/valuable#9 was actually the issue. Fixed it for me at least. @vadimgubin give that a shot.

@sonal241
Copy link

Hey,can I use this plugin for vuejs??? Or Please help me,If you have any suggestion about vuejs sitemap.
Thank you

@kuflash
Copy link
Owner

kuflash commented Oct 24, 2017

@sonal241 hey! Please create new issue for discuss this question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants