jprichardson / node-jsonfile

Easily read/write JSON files.
MIT License
1.2k stars 321 forks source link

issue when writing file #100

Closed irfansyedsasken closed 6 years ago

irfansyedsasken commented 6 years ago

Uncaught (in promise) TypeError: fs.readFile is not a function at Object.readFile (http://localhost:3000/static/js/bundle.js:60555:7) at DashBoard._callee3$ (http://localhost:3000/static/js/bundle.js:58450:25) at tryCatch (http://localhost:3000/static/js/bundle.js:59315:41) at Generator.invoke [as _invoke] (http://localhost:3000/static/js/bundle.js:59553:23) at Generator.prototype.(anonymous function) [as next] (http://localhost:3000/static/js/bundle.js:59367:22) at step (http://localhost:3000/static/js/bundle.js:58299:192) at http://localhost:3000/static/js/bundle.js:58299:362 at

RyanZim commented 6 years ago

@irfansyedsasken Are you trying to use jsonfile in a browser?

irfansyedsasken commented 6 years ago

@RyanZim yes using react js

RyanZim commented 6 years ago

This is a module for use in Node.js, not the browser. That's why you're getting this error.