Deno: error TS2349: This expression is not callable.

Created on 7 May 2020  路  1Comment  路  Source: denoland/deno

Hey!

Got this on deno -A index.ts

Type '{ get(key: string): string | undefined; set(key: string, value: string): void; toObject(): { [index: string]: string; }; }' has no call signatures.

const env = Deno.env();

File concerned config.ts looks like this :

const env = Deno.env();
export const APP_HOST = env.APP_HOST || "127.0.0.1";
export const APP_PORT = env.APP_PORT || 4000;

Setup :

deno 0.42.0
v8 8.2.308
typescript 3.8.3

Maybe it is an import issue, need to specify @0.42 in some url ... but how and where ?

Any suggestions ?
Thx

Most helpful comment

Upgrade to the latest release, deno 1.0.0-rc1, we have changed the API. Replace Deno.env() with Deno.env.toObject().

>All comments

Upgrade to the latest release, deno 1.0.0-rc1, we have changed the API. Replace Deno.env() with Deno.env.toObject().

Was this page helpful?
0 / 5 - 0 ratings