boopus_the_snootusB
Denoβ€’3y agoβ€’
6 replies
boopus_the_snootus

deno_console not being properly instantiated?

Not sure if it's indended, or if I am missing a step, but several core extensions, for example the deno_console crate, do not:
- specify an entrypoint for esm, leading to a panic on startup
- add their APIs to window or global, making them inert by default

In my implementation I've had to include a small extension of my own along-side console that does the following:
import { Console } from 'ext:deno_console/01_console.js'; // If nothing imports this file, the runtime will panic
const core = globalThis.Deno.core;
globalThis.console = new Console((msg, level) => core.print(msg, level > 1)); // The console never actually gets built so let's do that


So my question; is that intended behaviour? Or did I miss a step somewhere
Was this page helpful?