Skip to content

isolatedModule and responseTypeHeader error while running the sample code #8

@borsemayur2

Description

@borsemayur2

Code:

import { Application } from "https://deno.land/x/oak/mod.ts";

import { responseTimeHeader } from "https://deno.land/x/oak_middleware/observability/response_time_header.ts";
const app = new Application();

app.use(responseTimeHeader);

app.use((ctx: any, next: any) => {
  ctx.response.body = "Hello Oak!";
});
console.log("listening on port 8080");
app.listen({ port: 8080 });

I'm getting following errors:

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

TS2724 [ERROR]: '"https://deno.land/x/[email protected]/observability/response_time_header.ts"' has no exported member named 'responseTimeHeader'. Did you mean 'responseTypeHeader'?
import { responseTimeHeader } from "https://deno.land/x/oak_middleware/observability/response_time_header.ts";

   'responseTypeHeader' is declared here.
    export const responseTypeHeader: Middleware = async function (ctx, next) {
                 ~~~~~~~~~~~~~~~~~~
        at https://deno.land/x/[email protected]/observability/response_time_header.ts:22:14

The code at deno.land still points to responseTypeHeader. This seems the issue for responseTypeHeader error.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions