首页 > 解决方案 > apache-arrow 不能用打字稿编译

问题描述

我也为图书馆发布了这个问题。@apache-arrow/ts

我已经能够将它与webpack捆绑在一起,但我一直在考虑使用rollup它来解决我在库中遇到的其他问题。但是,这需要我先做tsc

这是我的配置有问题还是有问题apache-arrow

在我的package.json

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

在我的一个.ts文件中:

import { Table } from 'apache-arrow';

我运行时的输出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'.

标签: typescriptapache-arrow

解决方案


这个问题似乎与 TypeScript 版本有关:对我来说,它适用于 TS 4.0.2。但是更新到更高版本后,一切都出错了。也许会有所帮助。


推荐阅读