【发布时间】:2021-07-01 11:49:21
【问题描述】:
我也为@apache-arrow/ts 库发布了这个question。
我已经能够将它与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'.
【问题讨论】:
-
您找到解决方案了吗?我在使用 apache-arrow v6 时遇到了同样的问题,我发现的唯一解决方法是在
tsconfig.json中设置"skipLibCheck": true,。此外,我提交了一份错误报告 (issues.apache.org/jira/browse/ARROW-14933),希望他们能在某个时候修复输入错误。 -
我正在使用 6,我没有对我的
tsconfig.json进行任何更改。然而,4 和 5 不起作用。 -
查看另一个问题:stackoverflow.com/questions/66955863/…。 - 有人整理了一个 repo 来验证这一点。
-
那个人是我????它表明它在严格的类型检查下无法在 v6 中工作
-
哦,我的 - 我明白了。嗯,谢谢你把它放在一起。从 3 到 6 以来,Arrow 有了很大的改进,但这让我对 TS 库的波动性感到害怕。