2

I posted this question for the @apache-arrow/ts library as well.

I've been able to get this to bundle with webpack, but I've been considering using rollup instead for other issues I'm having with my library. However, that requires me to do a tsc first.

Is this an issue with my configuration or an issue with apache-arrow?

In my package.json:

"apache-arrow": "^3.0.0",
"typescript": "^4.1.3",

In one of my .ts files:

import { Table } from 'apache-arrow';

My output when running tsc:

node_modules/apache-arrow/Arrow.d.ts(47,466): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(47,641): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(48,471): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(48,646): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(62,352): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(62,527): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(63,353): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(63,528): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(64,353): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(64,528): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(65,353): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(65,528): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(66,354): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(66,529): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(67,354): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(67,529): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(68,355): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(68,530): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(69,355): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(69,530): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(70,360): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(70,535): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(71,357): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(71,532): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(72,358): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(72,533): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(73,358): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(73,533): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(74,358): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(74,533): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(75,359): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(75,534): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(76,359): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(76,534): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(77,360): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(77,535): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(78,360): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(78,535): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/Arrow.d.ts(79,365): error TS2304: Cannot find name 'ReadableStreamReadValueResult'.
node_modules/apache-arrow/Arrow.d.ts(79,540): error TS2304: Cannot find name 'ReadableStreamReadDoneResult'.
node_modules/apache-arrow/interfaces.d.ts(178,5): error TS2502: '[Type.FixedSizeList]' is referenced directly or indirectly in its own type annotation.
node_modules/apache-arrow/io/interfaces.d.ts(46,54): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(51,63): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(53,13): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(53,32): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(57,22): error TS2304: Cannot find name 'WritableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(57,51): error TS2304: Cannot find name 'PipeOptions'.
node_modules/apache-arrow/io/interfaces.d.ts(58,27): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(59,19): error TS2304: Cannot find name 'WritableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(61,18): error TS2304: Cannot find name 'PipeOptions'.
node_modules/apache-arrow/io/interfaces.d.ts(61,32): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(62,28): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/interfaces.d.ts(88,54): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/stream.d.ts(5,53): error TS2304: Cannot find name 'WritableStream'.
node_modules/apache-arrow/io/stream.d.ts(7,91): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/stream.d.ts(30,62): error TS2304: Cannot find name 'Response'.
node_modules/apache-arrow/io/stream.d.ts(30,73): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/whatwg/builder.d.ts(24,15): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/io/whatwg/builder.d.ts(25,15): error TS2304: Cannot find name 'WritableStream'.
node_modules/apache-arrow/io/whatwg/builder.d.ts(26,18): error TS2304: Cannot find name 'ReadableStreamDefaultController'.
node_modules/apache-arrow/ipc/reader.d.ts(19,47): error TS2304: Cannot find name 'Response'.
node_modules/apache-arrow/ipc/reader.d.ts(19,82): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/ipc/reader.d.ts(62,20): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/ipc/reader.d.ts(71,27): error TS2304: Cannot find name 'ByteLengthQueuingStrategy'.
node_modules/apache-arrow/ipc/reader.d.ts(74,19): error TS2304: Cannot find name 'WritableStream'.
node_modules/apache-arrow/ipc/reader.d.ts(75,19): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/ipc/reader.d.ts(236,5): error TS2717: Subsequent property declarations must have the same type.  Property 'schema' must be of type 'Schema<T>', but here has type 'Schema<any>'.
node_modules/apache-arrow/ipc/writer.d.ts(36,27): error TS2304: Cannot find name 'QueuingStrategy'.
node_modules/apache-arrow/ipc/writer.d.ts(42,19): error TS2304: Cannot find name 'WritableStream'.
node_modules/apache-arrow/ipc/writer.d.ts(43,19): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/ipc/writer.d.ts(65,54): error TS2304: Cannot find name 'ReadableStream'.
node_modules/apache-arrow/recordbatch.d.ts(17,18): error TS2430: Interface 'RecordBatch<T>' incorrectly extends interface 'StructVector<T>'.
  The types of 'slice(...).clone' are incompatible between these types.
    Type '(data: Data<Struct<T>>, children?: AbstractVector<any>[]) => RecordBatch<T>' is not assignable to type '<R extends DataType<Type, any> = Struct<T>>(data: Data<R>, children?: AbstractVector<R>[]) => VectorType<R>'.
      Types of parameters 'data' and 'data' are incompatible.
        Type 'Data<R>' is not assignable to type 'Data<Struct<T>>'.
          Type 'R' is not assignable to type 'Struct<T>'.
            Property 'dataTypes' is missing in type 'DataType<Type, any>' but required in type 'Struct<T>'.
node_modules/apache-arrow/recordbatch.d.ts(24,22): error TS2415: Class 'RecordBatch<T>' incorrectly extends base class 'StructVector<T>'.
node_modules/apache-arrow/util/buffer.d.ts(10,328): error TS2304: Cannot find name 'ReadableStreamReadResult'.

westandy
  • 1,360
  • 2
  • 16
  • 41
  • Did you find a solution? I ran into the same issues with apache-arrow v6 and the only work around I found is to set `"skipLibCheck": true,` in the `tsconfig.json`. Additionally, I filed a bug report (https://issues.apache.org/jira/browse/ARROW-14933) hoping that they will fix the typing errors at some point. – F Lekschas Nov 30 '21 at 19:05
  • Mine is working with 6, and I did not make any changes to my `tsconfig.json`. 4 and 5 however did not work. – westandy Dec 01 '21 at 17:42
  • See the other question: https://stackoverflow.com/questions/66955863/apache-arrow-ts-does-not-compile. - someone put together a repo to verify this. – westandy Dec 01 '21 at 17:43
  • 1
    That person is me and it shows that it's not working in v6 under strict type checking – F Lekschas Dec 01 '21 at 19:45
  • Oh my - I see. Well, thank you for putting that together. Arrow has drastically improved since 3 to 6, but this scares me with the volatility of the TS libraries. – westandy Dec 01 '21 at 21:08

1 Answers1

0

It seems like this problem is related to the TypeScript version: for me, it works fine with TS 4.0.2. But after updating to a later version, everything goes wrong. Maybe it will help.