TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'
See original GitHub issueHey there, it has taken me already 3 weeks I’m trying to fix this and I didn’t found a solution.
In my code source, I created a file called deps.ts
at my project root and I export denodb module (export { Database } from "https://deno.land/x/denodb@v1.0.12/mod.ts";)
. When I run my server, I got many errors that I need help. Theses are errors `error: TS1205 [ERROR]: Re-exporting a type when the ‘–isolatedModules’ flag is provided requires using ‘export type’.
export { LogLevels, LevelName } from “./levels.ts”;
~~~~~~~~~
at https://deno.land/std@0.63.0/log/mod.ts:13:21
TS1205 [ERROR]: Re-exporting a type when the ‘–isolatedModules’ flag is provided requires using ‘export type’. Deferred,
at https://deno.land/x/mysql@v2.5.0/deps.ts:3:3
TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { Client, ClientConfig } from "./src/client.ts";
~~~~~~~~~~~~
at https://deno.land/x/mysql@v2.5.0/mod.ts:1:18
TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { ObjectId, UpdateOptions } from "./ts/types.ts";
~~~~~~~~~~~~~
at https://raw.githubusercontent.com/eveningkid/deno_mongo/master/mod.ts:5:20
TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
ClientOptions as MongoDBClientOptions,
at https://deno.land/x/denodb@v1.0.12/unstable_deps.ts:11:3
Found 5 errors.`
Anyone got the same ? How to fix them ? I use Deno version 1.5.0, typescript 4.0.3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:11 (4 by maintainers)
Top GitHub Comments
I had the same problem (-isolatedModules…), this is what helped me to understand:
Type-Only Imports and Export https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-exports (…if you’ve hit issues under --isolatedModules, TypeScript’s transpileModule API, or Babel, this feature might be relevant…)
And here is another example of how I used export type
It seems the issue comes from this: https://deno.land/posts/v1.5#stricter-type-checks-in-stable Luckily, you can override this creating a
tsconfig.json
in you project with this content:Then, execute your code like this:
Let me know if this works for you! We have to wait for the others deps update their code. This is a temporary fix.