HametH
Denoβ€’15mo agoβ€’
3 replies
Hamet

Error running deno

Hello :)
I am very new to deno and need some help running basic stuff. I don't find proper documentation.

import { Application, Router } from "https://deno.land/x/oak/mod.ts"
import { viewEngine, dejsEngine, oakAdapter } from "https://deno.land/x/view_engine/mod.ts"


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

app.use(
  viewEngine(oakAdapter, dejsEngine, {
    viewRoot: `${Deno.cwd()}/static/templates`,
  })
);

app.use(router.routes());
app.use(router.allowedMethods());


console.log("Listening on port 8000");
await app.listen({ port: 8000 });



when trying to run this via
deno run main.ts


I get the error
error: Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword. 

import db from "https://raw.githubusercontent.com/jshttp/mime-db/v1.52.0/db.json" assert {
  type: "json",
};

  at https://deno.land/x/media_types@v3.0.3/mod.ts:32:1



How do I ignore this error? I tried via
"no-import-assertions"
but nothing changed
Was this page helpful?