Why am i receiving this (error: TS2376) while running oak.? Details of error in body

340 views Asked by At

I have this simple server.ts file.

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

const app = new Application();
const router = new Router();

router
.get("/",(ctx) => {
  ctx.response.body = "Router has been created";
  // Implement your code
  });

app.use(router.routes());
app.use(router.allowedMethods());
app.listen({port:8000});

I run this app with command:

deno run --allow-net server.ts

It throws this error:

error: TS2376 [ERROR]: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
  constructor(
  ^
    at https://deno.land/x/[email protected]/range.ts:102:3

I just want to use deno with oak instead of fighting with internal deno stuff. Is there any thing i am missing?

Thanks!

1

There are 1 answers

0
kwendo On

Am also experiencing the same after upgrading deno to 1.9.2 then back to lower versions 1.6.2 1.6.0 1.8.3

Just upgrade your version to 1.9.2. You will be sorted