“--isolatedModules”的问题标志和 RouterContext
当尝试运行我的 deno 应用程序时,出现以下错误,我不明白为什么..有人遇到过这个问题吗?
运行命令: eno run --allow-all server.ts
错误:
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/[email protected]/mod.ts";
export { MongoClient } from "https://deno.land/x/[email protected]/mod.ts";
export { hashSync, compareSync} from "https://deno.land/x/[email protected]/mod.ts";
import "https://deno.land/x/[email protected]/load.ts";
export * from "https://deno.land/x/[email protected]/mod.ts";
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:
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/[email protected]/mod.ts";
export { MongoClient } from "https://deno.land/x/[email protected]/mod.ts";
export { hashSync, compareSync} from "https://deno.land/x/[email protected]/mod.ts";
import "https://deno.land/x/[email protected]/load.ts";
export * from "https://deno.land/x/[email protected]/mod.ts";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 在类型名称上
type
修饰符来解决您的问题。这是 TS 版本 ≥4.5
的惯用且推荐的方法:You can use the
type
modifier on the type names to resolve your issue. This is the idiomatic and recommended approach for TS version ≥4.5
:有关说明,请参阅 --isolatedModules 。
检查 OAK RouterContext 他们确实
导出类型< /code> 他们自己。
所以顺其自然并
分成
See --isolatedModules for an explanation.
Checking with OAK RouterContext they do
export type
themselves.So go with the flow and split
into