Hamet
Hamet
DDeno
Created by Hamet on 10/13/2024 in #help
Transpile TS to JS
My app is serving a rendered ejs template as html. Inside my html there is
<script type="module" src="test.ts"></script>
<script type="module" src="test.ts"></script>
how does my app now return the typescript as javascript? I just get this error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "video/mp2t". Strict MIME type checking is enforced for module scripts per HTML spec.
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "video/mp2t". Strict MIME type checking is enforced for module scripts per HTML spec.
Im pretty new to deno and ts in general, so bear with me :)
11 replies
DDeno
Created by Hamet on 10/11/2024 in #help
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 });
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
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
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"
"no-import-assertions"
but nothing changed
4 replies