类型 'string' 不可分配给类型“"UnexpectedEof"”

Type 'string' is not assignable to type '"UnexpectedEof"'

编译我的 deno 应用程序时出现此错误:

$ deno compile --allow-all --unstable --output ./app ./index.ts
Check file:///home/ubuntu/www/iptvfish/iptvfish-api/index.ts
error: TS2416 [ERROR]: Property 'name' in type 'PartialReadError' is not assignable to the same property in base type 'UnexpectedEof'.
  Type 'string' is not assignable to type '"UnexpectedEof"'.
  name = "PartialReadError";
  ~~~~
    at https://deno.land/std@0.74.0/io/bufio.ts:27:3
TS2416 [ERROR]: Property 'name' in type 'PartialReadError' is not assignable to the same property in base type 'UnexpectedEof'.
  Type 'string' is not assignable to type '"UnexpectedEof"'.
  name = "PartialReadError";
  ~~~~
    at https://deno.land/std@0.83.0/io/bufio.ts:27:3

Found 2 errors.
$ deno -V
deno 1.13.0

代码在我升级 deno 之前有效

事实证明这是 mysql 驱动程序和 deno 1.13.0 的错误(已修复,但 denodb 尚未发布补丁)。

暂时你可以这样做:

// import { Database, SQLite3Connector } from 'https://deno.land/x/denodb/mod.ts';
import { Database, SQLite3Connector } from 'https://raw.githubusercontent.com/stillalivx/denodb/master/mod.ts';