react-router-sitemap icon indicating copy to clipboard operation
react-router-sitemap copied to clipboard

Cannot resolve module 'fs'

Open vadimgubin opened this issue 8 years ago • 11 comments

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 avatar Dec 05 '16 13:12 vadimgubin

@vadimgubin how you start script for build sitemap?

kuflash avatar Dec 05 '16 14:12 kuflash

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 avatar Dec 05 '16 14:12 vadimgubin

@vadimgubin script working in browser or server?

kuflash avatar Dec 05 '16 14:12 kuflash

on server when building app

vadimgubin avatar Dec 05 '16 14:12 vadimgubin

@vadimgubin very interesting) I will check today

kuflash avatar Dec 05 '16 14:12 kuflash

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

kuflash avatar Dec 05 '16 16:12 kuflash

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 avatar Dec 08 '16 20:12 kylerc

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

kuflash avatar Dec 08 '16 21:12 kuflash

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.

kylerc avatar Dec 08 '16 21:12 kylerc

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

sonal241 avatar Oct 24 '17 07:10 sonal241

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

kuflash avatar Oct 24 '17 09:10 kuflash