LibertyDSNP / parquetjs

Fully asynchronous, pure JavaScript implementation of the Parquet file format with additional features
MIT License
43 stars 24 forks source link

Webpack: Cannot read properties of undefined (reading 'stat') #126

Closed stefanonardo closed 1 month ago

stefanonardo commented 2 months ago

Steps to reproduce

webpack === 5.72.1 typescript === 5.3.3 @dsnp/parquetjs == 1.6.2 node === 20

craco.config.js

webpack: {
    configure: (webpackConfig) => {
      webpackConfig.resolve = {
        ...webpackConfig.resolve,
        alias: {
          '@dsnp/parquetjs': path.resolve(__dirname, 'src', 'parquetjs', 'dist', 'browser', 'parquet.cjs.js'),
        },
        fallback: {
          crypto: require.resolve('crypto-browserify'),
          stream: require.resolve('stream-browserify'),
        },
      };

      return webpackConfig;
    },
  },

app.js

import * as pq from '@dsnp/parquetjs';

const reader = await pq.ParquetReader.openFile(file.name);

Expected behaviour

it reads the file

Actual behaviour

throws error

Any logs, error output, etc?

TypeError: Cannot read properties of undefined (reading 'stat') at http://localhost:4000/static/js/vendors-node_modules_dsnp_parquetjs_dist_browser_parquet_cjs_js-node_modules_antd_es_divider_-cbb199.chunk.js:36235:16 at new Promise (<anonymous>) at Y1 (http://localhost:4000/static/js/vendors-node_modules_dsnp_parquetjs_dist_browser_parquet_cjs_js-node_modules_antd_es_divider_-cbb199.chunk.js:36234:10) at e.openFile (http://localhost:4000/static/js/vendors-node_modules_dsnp_parquetjs_dist_browser_parquet_cjs_js-node_modules_antd_es_divider_-cbb199.chunk.js:39916:19) at e.openFile (http://localhost:4000/static/js/vendors-node_modules_dsnp_parquetjs_dist_browser_parquet_cjs_js-node_modules_antd_es_divider_-cbb199.chunk.js:39793:22) at beforeUpload 

Any other comments?

...

wilwade commented 1 month ago

@stefanonardo Are you running this in a browser or in Node?

stefanonardo commented 1 month ago

hey @wilwade, thank you for answering. I moved to another library so I cannot test it anymore, you can close the issue. However, I was running it in a browser andfile.name was a string containing the name of an uploaded file (through Antd Upload component).

wilwade commented 1 month ago

Thanks for the update!