jeffutterJ
Denoβ€’11mo agoβ€’
4 replies
jeffutter

Missing `init_ops_and_esm` function for extensions in rust

Hi there, I'm just getting started with Deno and trying to embed it in rust. I'm using
deno_core
0.344.0
and
deno_console
0.204.0
. The docs for
deno_console
(and most docs about extensions) reference calling
init_opts_and_esm
like
deno_console::deno_console::init_ops_and_esm()
but this function doesn't seem to exist. I can't seem to find where it is defined, it's not in the
deno
repo or any cargo docs. I find the same on an extension that I create with
extension
as well.

There is an
init
function . However, when I try to use that I get a panic like:
thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deno_core-0.344.0/runtime/jsruntime.rs:750:9:
Failed to initialize a JsRuntime: Following modules were not evaluated; make sure they are imported from other code:
  - ext:deno_console/01_console.js

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


That happens before I can run any js code to import the module.

Any idea what I'm doing wrong here?
Was this page helpful?