私は最近、v1.3.0からv1.4.0までのDENOを更新します。更新する前に、コードは問題ありませんが、その後このエラーが発生しました。
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
_
この問題を解決するページを見つけましたが、このエラーはサードパーティのライブラリーから来るようです。また、デニンを使用してスクリプトを実行します。これが私のインポートされたパッケージです。
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";
_
そしてこれは私のdenon.jsonです:
{
"$schema": "https://deno.land/x/denon/schema.json",
"scripts": {
"start": {
"cmd": "deno run --unstable server.ts",
"allow": [
"net",
"write",
"read",
"plugin"
]
}
}
}
_
これを修正する方法はありますか?またはデノーをダウングレードする方法は?
または必要に応じてimport
の代わりに_import type
を行うこともできます。