D
Deno

help

deno_console not being properly instantiated?

Bbaphomet_the_traveller9/27/2023
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
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
ABTAndreu Botella (they/them)9/27/2023
about the second point, deno_console doesn't actually add any APIs to the global rather, V8 ships with a default console built-in that doesn't print to stdout but instead sends the logs to devtools
Bbaphomet_the_traveller9/27/2023
Oh! Ok so that snippet is the correct way to redirect it to deno_console and proper output?
ABTAndreu Botella (they/them)9/27/2023
yeah
Bbaphomet_the_traveller9/27/2023
Ok sweet. And since that's needed anyway the import thing doesn't matter either Thanks!

Looking for more? Join the community!

Recommended Posts
Tailwind nonfunctional on fresh-update from 1.3.1 -> 1.4.3After running `deno run -A -r https://fresh.deno.dev/update .` on my project, the tailwind styles doassertEquals deprecated in vscode?Since upgrading to std@0.202.0 I'm seeing that assertEquals is marked deprecated, but I can't see whForce await import() to import a fresh copy?I have a Deno instance that dynamically loads a module with: `await import("some/module.js")` The mFresh ClassList Brokenhttps://github.com/Leave TLS connection open in between testsWhen I have 2 tests that use a database connection and attempt to close the connection `afterAll` thNvim tsserver clash with denolsI have read the docs and added a root_dir in my lua lsp file but for some reason tsserver still lanccircular type reference nonsensewhy does removing an array nest cause this to be a circular dependency?? shouldn't it be functionallGetting exports from an evaluated module with get_module_namespace always results in null valuesTrying to get module exports like the example [here](https://github.com/denoland/deno/pull/14026/fiIs there any way to define a signal inside a route component?Is there any way to define a signal inside a route component? I am trying to do it but an error raiDeno EmitHow come does `deno bundle` work a lot differently to Deno emit (https://deno.land/x/emit@0.28.0 )? `deno lsp` does not understand bare imports without prefixEven in minimal project, freshly created from a template, Deno marks imports as errors and doesn't uWhen I use crypto in this code, it returns 'Unknown cipher.'const secret ="**1111111111111111111**"; let encryptedText='test'; const decipher = crypto.cTroubleshooting deno.land downloadsI have docker containers, within a minikube cluster, that have trouble downloading https://deno.landRun remote Fresh application code locally.Is it possible to run a remotely hosted Fresh application? E.g. I'm attempting to do `deno run -A h