denodrivers / postgres

PostgreSQL driver for Deno

Home Page:https://denodrivers.github.io/postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when running the code from docs

benkeil opened this issue · comments

╰╴λ deno run --allow-net --allow-read --unstable cli.ts
Check file:///xxx/code/applications/cli-v2/cli.ts
error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
  Deferred,
  ~~~~~~~~
    at https://deno.land/x/postgres@v0.4.3/deps.ts:7:3

TS2345 [ERROR]: Argument of type 'T | undefined' is not assignable to parameter of type 'T | PromiseLike<T>'.
  Type 'undefined' is not assignable to type 'T | PromiseLike<T>'.
      resolve(value);
              ~~~~~
    at https://deno.land/x/postgres@v0.4.3/utils.ts:94:15

TS2790 [ERROR]: The operand of a 'delete' operator must be optional.
    delete this.conn;
           ~~~~~~~~~
    at https://deno.land/x/postgres@v0.4.3/connection.ts:612:12

TS2790 [ERROR]: The operand of a 'delete' operator must be optional.
    delete this.bufReader;
           ~~~~~~~~~~~~~~
    at https://deno.land/x/postgres@v0.4.3/connection.ts:613:12

TS2790 [ERROR]: The operand of a 'delete' operator must be optional.
    delete this.bufWriter;
           ~~~~~~~~~~~~~~
    at https://deno.land/x/postgres@v0.4.3/connection.ts:614:12

TS2790 [ERROR]: The operand of a 'delete' operator must be optional.
    delete this.packetWriter;
           ~~~~~~~~~~~~~~~~~
    at https://deno.land/x/postgres@v0.4.3/connection.ts:615:12

Found 6 errors.

You are using a very outdated version of deno-postgres, please tag your versions when importing like this:

https://deno.land/x/postgres@v0.11.3/connection.ts