You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
borsemayur2
changed the title
isolateModule and responseTypeHeader error while running the sample code
isolatedModule and responseTypeHeader error while running the sample code
Apr 15, 2021
import {responseTimeHeader} from "https://raw.githubusercontent.com/oakserver/middleware/main/observability/response_time_header.ts"
errors:
TS2345 [ERROR]: Argument of type 'import("https://deno.land/x/[email protected]/middleware.ts").Middleware<Record<string, any>, import("https://deno.land/x/[email protected]/context.ts").Context<Record<string, any>>>' is not assignable to parameter of type 'import("https://deno.land/x/[email protected]/middleware.ts").Middleware<Record<string, any>, import("https://deno.land/x/[email protected]/context.ts").Context<Record<string, any>>>'.
Types of parameters 'context' and 'context' are incompatible.
Type 'import("https://deno.land/x/[email protected]/context.ts").Context<Record<string, any>>' is not assignable to type 'import("https://deno.land/x/[email protected]/context.ts").Context<Record<string, any>>'.
Types of property 'app' are incompatible.
Type 'Application<State>' is not assignable to type 'Application<any>'.
Property '#middleware' in type 'Application' refers to a different member that cannot be accessed from within type 'Application'.
app.use(responseTimeHeader);
~~~~~~~~~~~~~~~~~~
Code:
I'm getting following errors:
The code at
deno.land
still points toresponseTypeHeader
. This seems the issue for responseTypeHeader error.The text was updated successfully, but these errors were encountered: