apache / apache/arrow-js

[JS] The package.json file incorrectly specifies sideEffects: false

Open
#73 8 comments 2 reactions 1 assignee Claimed by @domoritz View on GitHub
Type: bug
Dominant language
TypeScript
Stars
112
Forks
23
Avg merge
21h 18m
Merged PRs (30d)
8

Description

### Describe the bug, including details regarding any error messages, version, and platform.

**Problem**

When building a Node application with Webpack, calls to `RecordBatchStreamWriter.toNodeStream` fail with the error:
```
Error: "toNodeStream" not available in this environment
```

**Cause**

The `apache-arrow` package.json file [specifies `"sideEffects": false`](https://github.com/apache/arrow/blob/apache-arrow-13.0.0/js/gulp/package-task.js#L69), but the Node overrides required for streaming Arrow files are [applied as a side effect](https://github.com/apache/arrow/blob/apache-arrow-13.0.0/js/src/Arrow.node.ts#L27). I believe this is true for the [DOM overrides as well](https://github.com/apache/arrow/blob/apache-arrow-13.0.0/js/src/Arrow.dom.ts#L27).

**Suggested Fix**

I haven't tested this, but I think that wrapping the overrides in these two files in an IIFE [as is done here](https://github.com/apache/arrow/blob/143b475f94dad840be2eb109ff27f3181791ad9f/js/src/table.ts#L380) will fix this issue in the Webpack build.

### Component(s)

JavaScript

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.