gkindel / csv-js

A Comma-Separated Values parser for JavaScript. Standards-based, stand alone, and no regular expressions.
http://gkindel.github.io/cxv-js/csv.html
106 stars 35 forks source link

Cannot import with webpack #23

Closed squgeim closed 7 years ago

squgeim commented 7 years ago

When trying to use this library in a React project with Webpack, it fails to build and gives the following error:

229:20-27 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

The problem seems to be the way require is being used in CSV.stream and CSV.stream.json functions. For my use case, I only required the parse method so I have commented these parts of the code and everything works fine.