J'ai récemment mis à jour Deno à partir de V1.3.0 à V1.4.0. Avant de mettre à jour, mon code n'a aucun problème, mais après cela, j'ai cette erreur:
error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
LevelName,
~~~~~~~~~
at https://deno.land/x/[email protected]/deps.ts:8:3
TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { LogConfig, setup, prefix } from "./branch.ts";
~~~~~~~~~
at https://deno.land/x/[email protected]/mod.ts:3:10
TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { WatcherConfig } from "./watcher.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/[email protected]/src/config.ts:14:1
TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { RunnerConfig } from "./runner.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/[email protected]/src/config.ts:15:1
TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Args } from "./args.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/[email protected]/src/config.ts:18:1
TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Template } from "./templates.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/[email protected]/src/config.ts:19:1
TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Denon, DenonEvent } from "../denon.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/[email protected]/src/daemon.ts:5:1
TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { CompleteDenonConfig } from "./config.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/[email protected]/src/daemon.ts:6:1
TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { ScriptOptions } from "./scripts.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/[email protected]/src/daemon.ts:7:1
J'ai trouvé une page qui corrige ce problème, mais cette erreur ressemble à celle de la bibliothèque tierce. J'utilise également Denon pour exécuter le script. Voici mon package importé:
import { Application } from "https://deno.land/x/Oak/mod.ts";
import { oakCors } from "https://deno.land/x/cors/mod.ts";
import { Router } from "https://deno.land/x/Oak/mod.ts";
import { RouterContext } from "https://deno.land/x/Oak/mod.ts";
import * as bcrypt from "https://deno.land/x/bcrypt/mod.ts";
import { SmtpClient } from "https://deno.land/x/smtp/mod.ts";
import { MongoClient } from "https://deno.land/x/[email protected]/mod.ts";
Et c'est mon Denon.json:
{
"$schema": "https://deno.land/x/denon/schema.json",
"scripts": {
"start": {
"cmd": "deno run --unstable server.ts",
"allow": [
"net",
"write",
"read",
"plugin"
]
}
}
}
Y'a t'il un moyen d'arranger cela? ou un moyen de descente Deno?
Ou vous pourriez juste faire import type
au lieu de juste import
si nécessaire.