jackvial opened a new issue, #49:
URL: https://github.com/apache/arrow-js/issues/49

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   When I try to build my project with  `"@apache-arrow/ts": "^17.0.0"` as a 
dependency I get the following error
   I'm using `"typescript": "^5.6.2"`
   
   ```
   node_modules/@apache-arrow/ts/builder/map.ts:37:25 - error TS2352: 
Conversion of type 'MapRow<K, V>' to type 'Map<K, V>' may be a mistake because 
neither type sufficiently overlaps with the other. If this was intentional, 
convert the expression to 'unknown' first.
     Type 'MapRow<K, V>' is missing the following properties from type 'Map<K, 
V>': clear, delete, forEach, get, and 6 more.
   
   37         const current = pending.get(index) as Map<K, V> | undefined;
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
   
   Found 1 error in node_modules/@apache-arrow/ts/builder/map.ts:37
   ```
   
   The following change appears to fix it but maybe not a great solution.
   ```
       public setValue(index: number, value: MapValueExt<K, V>) {
           // const row = (value instanceof Map ? value : new 
Map(Object.entries(value))) as MapValue<K, V>;
           const row = (value instanceof Map ? value : new 
Map(Object.entries(value))) as unknown as MapValue<K, V>;
           const pending = this._pending || (this._pending = new Map() as 
MapValues<K, V>);
           // const current = pending.get(index) as Map<K, V> | undefined;
           const current = pending.get(index);
           current && (this._pendingLength -= current.size);
           this._pendingLength += row.size;
           pending.set(index, row);
       }
   ``
   
   But then I run into a runtime error which appears to be because 
`node_modules/@apache-arrow/ts/Arrow.node.ts` is trying to import `.js` files 
that don't exist
   
   
   ![Screenshot 2024-09-21 at 1 01 58 
PM](https://github.com/user-attachments/assets/886aa806-7a69-4746-9588-7d6fbfee1645)
   
   
   ### Component(s)
   
   TypeScript, JavaScript


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to