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

TypeError: data_forge__WEBPACK_IMPORTED_MODULE_8__.readFileSync is not a function #35

Closed
amitwats opened this issue Apr 3, 2019 · 3 comments

Comments

@amitwats
Copy link

amitwats commented Apr 3, 2019

When using const df=dataForge.readFile('SalesJan2009.csv').parseCSV(); in the render method of a ReactJS class the browser shows an error

TypeError: data_forge__WEBPACK_IMPORTED_MODULE_8__.readFileSync is not a function

@ashleydavis
Copy link
Member

You can't access the file system from a web browser. It's just not possible.

You should try loading your data through a REST API.

@amitwats
Copy link
Author

amitwats commented Apr 5, 2019

@ashleydavis Thanks for the quick turn around. I feel the error message shown should mention this. At the moment it sounds like the function the user typed is wrong. Instead a message like "File Resource inaccessible error" would be more appropriate.

@ashleydavis
Copy link
Member

I can appreciate your confusion and I do mention several places in my documentation that this is how it works.

In any case I'm not sure how I'd put the error message in there (please suggest a way for me to do that and I'll put it in there for you).

Besides, most web developers already know they can't access the file system from the browser. If that were possible then all sorts of web pages would be stealing data from your computer.

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

2 participants