Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Problems with '–isolatedModules' flag and RouterContext

When trying to run my deno app the following error comes out and I don’t understand why .. Has anyone encountered this problem?

run command: deno run –allow-all server.ts

error:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
  RouterContext,
  ~~~~~~~~~~~~~
    at file:///Users/XXXX/Documents/DenoAPP/deps.ts:4:3

deps.ts

export { Application, Router, RouterContext, Context, send } from "https://deno.land/x/oak@v10.4.0/mod.ts";
export { MongoClient } from "https://deno.land/x/mongo@v0.29.2/mod.ts";
export { hashSync, compareSync} from "https://deno.land/x/bcrypt@v0.3.0/mod.ts";
import "https://deno.land/x/dotenv@v3.2.0/load.ts";
export * from "https://deno.land/x/djwt@v2.4/mod.ts";

>Solution :

See –isolatedModules for an explanation.

Checking with OAK RouterContext they do export type themselves.

So go with the flow and split

export { Application, Router, RouterContext, Context, send } from "https://deno.land/x/oak@v10.4.0/mod.ts";

into

export { Application, Router, send } from "https://deno.land/x/oak@v10.4.0/mod.ts";
export type { RouterContext, Context } from "https://deno.land/x/oak@v10.4.0/mod.ts";
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading