Skip to content

context assert error "Assertions require every name in the call target to be declared with an explicit type annotation" #446

Answered by kitsonk
nameOfUser0236 asked this question in Q&A
Discussion options

You must be logged in to vote

This is a design limitation of TypeScript (see: microsoft/TypeScript#36931).

You need to do something like:

import * as oak from "https://deno.land/x/oak/mod.ts";
import type { Context } from "https://deno.land/x/oak/mod.ts";

const app = new oak.Application();

app.use((ctx: Context) => {
    ctx.assert(true);
});

await app.listen({ port: 8000 });

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nameOfUser0236
Comment options

Answer selected by nameOfUser0236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #445 on January 09, 2022 22:16.