trxcllnt commented on issue #9752:
URL: https://github.com/apache/arrow/issues/9752#issuecomment-809690137


   @westandy I replicated this error locally and found a solution from [this 
comment](https://github.com/graphql/graphql-js/issues/2721#issuecomment-723008284).
 I installed the latest versions of the dependencies, i.e.
   ```json
     "scripts": {
       "build": "webpack -c webpack.config.js",
     },
     "devDependencies": {
       "ts-loader": "8.1.0",
       "typescript": "4.2.3",
       "webpack": "5.28.0",
       "webpack-cli": "4.6.0"
     },
     "dependencies": {
       "apache-arrow": "3.0.0"
     }
   ```
   
   Here's the full working `webpack.config.js`:
   
   ```js
   const path = require('path');
   
   module.exports = {
       target: 'node',
       mode: 'production',
       entry: './src/index.ts',
       output: {
           filename: 'bundle.js',
           path: path.resolve(__dirname, 'dist'),
           libraryTarget: 'umd'
       },
       resolve: {
           extensions: ['.ts', '.mjs', '.js']
       },
       module: {
           // keeps a ref to the native require fn for dynamic loading
           noParse: /\/nativeRequire.js$/,
           rules: [
               {
                   test: /\.ts$/,
                   use: {
                       loader: 'ts-loader',
                       options: { configFile: 'tsconfig.prod.json' }
                   }
               },
               {
                   test: /\.m?js/,
                   resolve: {
                       fullySpecified: false
                   }
               },
           ]
       }
   };
   ```
   
   And the output:
   ```
   ptaylor@tko:/tmp/arrow-ts-webpack$ npm run build 
   
   > [email protected] build /tmp/arrow-ts-webpack
   > webpack -c webpack.config.js
   
   asset bundle.js 210 KiB [emitted] [minimized] (name: main)
   asset ../types/index.d.ts 11 bytes [compared for emit]
   orphan modules 656 KiB [orphan] 102 modules
   runtime modules 670 bytes 3 modules
   cacheable modules 660 KiB
     ./src/index.ts 289 bytes [built] [code generated]
     ./node_modules/apache-arrow/Arrow.dom.mjs + 102 modules 660 KiB [built] 
[code generated]
   webpack 5.28.0 compiled successfully in 5978 ms
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to