@apache-arrow/ts 不编译

问题描述

我也为通用 apache-arrow 图书馆发布了此 question

我目前可以将我的 repo 与 webpack 捆绑在一起,但由于其他一些问题,我正在考虑同时使用 typescript 和 rollup。但是 apache-arrow 使打字稿部分变得非常困难。见下文:

在我的package.json中,

    "@apache-arrow/ts": "^3.0.0","typescript": "^4.1.3",

在我的一个文件中,我有

import { Table } from '@apache-arrow/ts';

在我的tsconfig.json中:

{
  "compilerOptions": {
    "outDir": "types","removeComments": true,"allowJs": true,"preserveConstEnums": true,"module": "Commonjs","target": "es5","declaration": true,"esModuleInterop": true,"sourceMap": true,"lib": ["esnext"],"resolveJsonModule": true,"moduleResolution": "node","allowSyntheticDefaultImports": true,"paths": {
      "*": ["types/*"]
    },"baseUrl": "./","typeRoots": ["node_modules/@types"],"types": ["jest","node"],"alwaysstrict": true,"noImplicitAny": true
  },"include": ["src/**/*"]
}
  

最后,我运行 tsc 时的输出

node_modules/@apache-arrow/ts/Arrow.dom.ts(18,28): error TS2307: Cannot find module './io/adapters' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.dom.ts(19,25): error TS2307: Cannot find module './builder/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.dom.ts(20,35): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.dom.ts(21,35): error TS2307: Cannot find module './ipc/writer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.dom.ts(22,29): error TS2307: Cannot find module './io/whatwg/iterable' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.dom.ts(23,41): error TS2307: Cannot find module './io/whatwg/builder' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.dom.ts(24,51): error TS2307: Cannot find module './io/whatwg/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.dom.ts(25,51): error TS2307: Cannot find module './io/whatwg/writer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(18,28): error TS2307: Cannot find module './io/adapters' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(19,25): error TS2307: Cannot find module './builder/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(20,35): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(21,35): error TS2307: Cannot find module './ipc/writer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(22,30): error TS2307: Cannot find module './io/node/iterable' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(23,42): error TS2307: Cannot find module './io/node/builder' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(24,52): error TS2307: Cannot find module './io/node/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.node.ts(25,52): error TS2307: Cannot find module './io/node/writer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(68,8): error TS2307: Cannot find module './vector/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(90,8): error TS2307: Cannot find module './builder/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(92,91): error TS2307: Cannot find module './io/stream' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(93,141): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(94,106): error TS2307: Cannot find module './ipc/writer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(95,70): error TS2307: Cannot find module './ipc/message' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(96,25): error TS2307: Cannot find module './ipc/Metadata/message' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(98,107): error TS2307: Cannot find module './io/interfaces' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(99,81): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(101,27): error TS2307: Cannot find module './util/bn' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(102,28): error TS2307: Cannot find module './util/int' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(103,28): error TS2307: Cannot find module './util/bit' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(104,29): error TS2307: Cannot find module './util/math' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(105,31): error TS2307: Cannot find module './util/buffer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(106,31): error TS2307: Cannot find module './util/vector' or its corresponding type declarations.
node_modules/@apache-arrow/ts/Arrow.ts(107,28): error TS2307: Cannot find module './compute/predicate' or its corresponding type declarations.
node_modules/@apache-arrow/ts/column.ts(24,45): error TS2307: Cannot find module './vector/chunked' or its corresponding type declarations.
node_modules/@apache-arrow/ts/column.ts(32,14): error TS2420: Class 'Column<T>' incorrectly implements interface 'applicative<T,Column<T>>'.
  Property '[Symbol.isConcatSpreadable]' is missing in type 'Column<T>' but required in type 'applicative<T,Column<T>>'.
node_modules/@apache-arrow/ts/column.ts(34,25): error TS2344: Type 'Column<T>' does not satisfy the constraint 'AbstractVector<any>'.
  Type 'Column<T>' is missing the following properties from type 'AbstractVector<any>': TType,TArray,TValue,data,and 15 more.
node_modules/@apache-arrow/ts/column.ts(35,26): error TS2344: Type 'Column<T>' does not satisfy the constraint 'AbstractVector<any>'.
node_modules/@apache-arrow/ts/column.ts(58,21): error TS2339: Property 'new' does not exist on type 'typeof AbstractVector'.
node_modules/@apache-arrow/ts/column.ts(64,54): error TS7031: Binding element 'nullCount' implicitly has an 'any' type.
node_modules/@apache-arrow/ts/column.ts(75,66): error TS2339: Property '_chunkOffsets' does not exist on type 'Column<T>'.
node_modules/@apache-arrow/ts/column.ts(87,32): error TS2339: Property '_chunks' does not exist on type 'Column<T>'.
node_modules/@apache-arrow/ts/column.ts(93,40): error TS2551: Property 'numChildren' does not exist on type 'Column<T>'. Did you mean '_children'?
node_modules/@apache-arrow/ts/column.ts(99,28): error TS2339: Property 'type' does not exist on type 'Column<T>'.
node_modules/@apache-arrow/ts/column.ts(100,27): error TS2339: Property '_chunks' does not exist on type 'Column<T>'.
node_modules/@apache-arrow/ts/column.ts(101,23): error TS7006: Parameter 'vector' implicitly has an 'any' type.
node_modules/@apache-arrow/ts/column.ts(101,34): error TS2347: Untyped function calls may not accept type arguments.
node_modules/@apache-arrow/ts/column.ts(102,26): error TS7006: Parameter 'vec' implicitly has an 'any' type.
node_modules/@apache-arrow/ts/column.ts(120,98): error TS2344: Type 'N' does not satisfy the constraint '(...args: any) => any'.
node_modules/@apache-arrow/ts/data.ts(19,32): error TS2307: Cannot find module './util/bit' or its corresponding type declarations.
node_modules/@apache-arrow/ts/data.ts(20,34): error TS2307: Cannot find module './util/bit' or its corresponding type declarations.
node_modules/@apache-arrow/ts/data.ts(23,63): error TS2307: Cannot find module './util/buffer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/enum.ts(18,26): error TS2307: Cannot find module './fb/Schema' or its corresponding type declarations.
node_modules/@apache-arrow/ts/enum.ts(19,27): error TS2307: Cannot find module './fb/Message' or its corresponding type declarations.
node_modules/@apache-arrow/ts/interfaces.ts(22,23): error TS2307: Cannot find module './vector/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/interfaces.ts(23,27): error TS2307: Cannot find module './builder/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/interfaces.ts(24,32): error TS2307: Cannot find module './builder/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/interfaces.ts(144,57): error TS2344: Type 'T["TType"]' does not satisfy the constraint 'Type | DataType<Type,any>'.
  Type 'T["TType"]' is not assignable to type 'DataType<Type,any>'.
node_modules/@apache-arrow/ts/interfaces.ts(144,57): error TS2536: Type '"TType"' cannot be used to index type 'T'.
node_modules/@apache-arrow/ts/interfaces.ts(160,44): error TS2536: Type '"type"' cannot be used to index type 'T'.
node_modules/@apache-arrow/ts/recordbatch.ts(23,28): error TS2307: Cannot find module './util/compat' or its corresponding type declarations.
node_modules/@apache-arrow/ts/recordbatch.ts(24,25): error TS2307: Cannot find module './vector/chunked' or its corresponding type declarations.
node_modules/@apache-arrow/ts/recordbatch.ts(25,33): error TS2307: Cannot find module './util/args' or its corresponding type declarations.
node_modules/@apache-arrow/ts/recordbatch.ts(27,38): error TS2307: Cannot find module './util/recordbatch' or its corresponding type declarations.
node_modules/@apache-arrow/ts/recordbatch.ts(29,79): error TS2307: Cannot find module './vector/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/recordbatch.ts(41,14): error TS2420: Class 'RecordBatch<T>' incorrectly implements interface 'applicative<Struct<T>,Table<T>>'.
  Property '[Symbol.isConcatSpreadable]' is missing in type 'RecordBatch<T>' but required in type 'applicative<Struct<T>,Table<T>>'.
node_modules/@apache-arrow/ts/recordbatch.ts(43,25): error TS2344: Type 'RecordBatch<T>' does not satisfy the constraint 'AbstractVector<any>'.
  Type 'RecordBatch<T>' is missing the following properties from type 'AbstractVector<any>': TType,and 16 more.
node_modules/@apache-arrow/ts/recordbatch.ts(44,26): error TS2344: Type 'RecordBatch<T>' does not satisfy the constraint 'AbstractVector<any>'.
node_modules/@apache-arrow/ts/recordbatch.ts(48,19): error TS2394: This overload signature is not compatible with its implementation signature.
node_modules/@apache-arrow/ts/recordbatch.ts(62,31): error TS7006: Parameter 'x' implicitly has an 'any' type.
node_modules/@apache-arrow/ts/recordbatch.ts(63,32): error TS2556: Expected 2-3 arguments,but got 0 or more.
node_modules/@apache-arrow/ts/recordbatch.ts(63,83): error TS7006: Parameter 'x' implicitly has an 'any' type.
node_modules/@apache-arrow/ts/recordbatch.ts(86,57): error TS2339: Property '_children' does not exist on type 'RecordBatch<T>'.
node_modules/@apache-arrow/ts/recordbatch.ts(92,48): error TS7031: Binding element 'data' implicitly has an 'any' type.
node_modules/@apache-arrow/ts/recordbatch.ts(107,57): error TS2339: Property 'data' does not exist on type 'RecordBatch<T>'.
node_modules/@apache-arrow/ts/recordbatch.ts(108,67): error TS2339: Property 'length' does not exist on type 'RecordBatch<T>'.
node_modules/@apache-arrow/ts/recordbatch.ts(132,19): error TS2339: Property 'data' does not exist on type 'T'.
node_modules/@apache-arrow/ts/schema.ts(21,28): error TS2307: Cannot find module './util/args' or its corresponding type declarations.
node_modules/@apache-arrow/ts/schema.ts(22,33): error TS2307: Cannot find module './util/args' or its corresponding type declarations.
node_modules/@apache-arrow/ts/schema.ts(23,38): error TS2307: Cannot find module './visitor/typecomparator' or its corresponding type declarations.
node_modules/@apache-arrow/ts/schema.ts(98,25): error TS2569: Type 'Map<number,DataType<Type,any>>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
node_modules/@apache-arrow/ts/schema.ts(98,47): error TS2569: Type 'Map<number,any>>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
node_modules/@apache-arrow/ts/schema.ts(150,24): error TS2569: Type 'Map<any,any>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
node_modules/@apache-arrow/ts/schema.ts(150,46): error TS2569: Type 'Map<any,any>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
node_modules/@apache-arrow/ts/table.ts(22,27): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(23,35): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(25,46): error TS2307: Cannot find module './util/args' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(27,56): error TS2307: Cannot find module './util/compat' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(28,64): error TS2307: Cannot find module './ipc/writer' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(29,88): error TS2307: Cannot find module './util/recordbatch' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(30,96): error TS2307: Cannot find module './vector/index' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(46,23): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(46,70): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(47,30): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(47,77): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(48,26): error TS2307: Cannot find module './compute/predicate' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(48,71): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(49,30): error TS2307: Cannot find module './compute/predicate' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(49,72): error TS2307: Cannot find module './compute/dataframe' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(52,14): error TS2420: Class 'Table<T>' incorrectly implements interface 'applicative<Struct<T>,Table<T>>'.
  Property '[Symbol.isConcatSpreadable]' is missing in type 'Table<T>' but required in type 'applicative<Struct<T>,Table<T>>'.
node_modules/@apache-arrow/ts/table.ts(55,25): error TS2344: Type 'Table<T>' does not satisfy the constraint 'AbstractVector<any>'.
  Type 'Table<T>' is missing the following properties from type 'AbstractVector<any>': TType,and 12 more.
node_modules/@apache-arrow/ts/table.ts(56,26): error TS2344: Type 'Table<T>' does not satisfy the constraint 'AbstractVector<any>'.
node_modules/@apache-arrow/ts/table.ts(64,84): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(65,84): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(66,84): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(67,84): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(68,84): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(69,84): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(108,95): error TS2307: Cannot find module './ipc/reader' or its corresponding type declarations.
node_modules/@apache-arrow/ts/table.ts(205,39): error TS2551: Property '_length' does not exist on type 'Table<T>'. Did you mean 'length'?
node_modules/@apache-arrow/ts/table.ts(207,40): error TS2339: Property '_numChildren' does not exist on type 'Table<T>'.
node_modules/@apache-arrow/ts/table.ts(223,40): error TS2551: Property 'numChildren' does not exist on type 'Table<T>'. Did you mean '_children'?
node_modules/@apache-arrow/ts/table.ts(230,39): error TS2339: Property 'getChildAt' does not exist on type 'RecordBatch<T>'.
node_modules/@apache-arrow/ts/table.ts(247,21): error TS2551: Property '_length' does not exist on type 'Table<T>'. Did you mean 'length'?
node_modules/@apache-arrow/ts/table.ts(255,54): error TS2339: Property 'length' does not exist on type 'RecordBatch<T>'.
node_modules/@apache-arrow/ts/table.ts(255,62): error TS2339: Property 'data' does not exist on type 'RecordBatch<T>'.
node_modules/@apache-arrow/ts/table.ts(291,94): error TS7006: Parameter 'vector' implicitly has an 'any' type.
node_modules/@apache-arrow/ts/type.ts(24,38): error TS2307: Cannot find module './visitor/typecomparator' or its corresponding type declarations.
node_modules/@apache-arrow/ts/vector.ts(20,25): error TS2307: Cannot find module './vector/chunked' or its corresponding type declarations.
node_modules/@apache-arrow/ts/vector.ts(34,23): error TS2304: Cannot find name 'Vector'.
node_modules/@apache-arrow/ts/vector.ts(68,74): error TS2304: Cannot find name 'Vector'.
node_modules/@apache-arrow/ts/visitor.ts(109,34): error TS7011: Function expression,which lacks return-type annotation,implicitly has an 'any' return type.

解决方法

感谢您的报告,这应该会在即将发布的 4.0.0 版本 (https://github.com/apache/arrow/pull/9954) 中修复

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...