【发布时间】:2021-08-15 12:36:05
【问题描述】:
编译我的 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 之前工作
【问题讨论】:
-
你是直接导入
std/io/bufio还是被另一个依赖导入? std 库与 Deno 一起进行版本控制,并且每个新版本的 std 库都保证可以与该版本的 Deno 一起使用。 (它不一定向后兼容。)您可以尝试将该依赖项更新为兼容版本:https://deno.land/std@0.104.0/io/bufio.ts如果您控制导入,或者您可以使用import map 将旧版本说明符映射到当前版本。跨度> -
必须是橡木或 denodb 使用它。我没有导入它。
-
我不得不对一些依赖于
Deno命名空间属性的版本特定语义的子依赖项使用导入映射方法,它为我解决了类似的问题。如果这最终对您有用,或者您需要更多详细信息,我将创建一个正确的答案。
标签: typescript deno