如何修复 Deno 中的 "must be declared in an enclosing class" 错误?

How to fix "must be declared in an enclosing class" error in Deno?

我编译了我的 deno 应用程序,但在我的一台服务器上出现了这个错误:

$ ./api                                                        
error: Uncaught SyntaxError: Private field '#h1' must be declared in an enclosing class
    at file://$deno$/bundle.js:3004:16

其他两台服务器运行良好。

其他服务器是 运行 Ubuntu 20.04.3 LTS

deno -V 是 1.15.3

所以我必须通过 -r 标志来重新编译 typescript

$ deno compile --allow-all --unstable -r --no-check --output ./api ./index.ts

它现在运行